JavaNetClientBuilder

sealed abstract class JavaNetClientBuilder[F[_]] extends BackendBuilder[F, Client[F]]

Builder for a Client backed by on java.net.HttpUrlConnection.

The java.net client adds no dependencies beyond http4s-client. This client is generally not production grade, but convenient for exploration in a REPL.

All I/O operations in this client are blocking.

Value Params
blockingExecutionContext

An ExecutionContext on which blocking operations will be performed.

Companion
object
trait BackendBuilder[F, Client[F]]
class Object
trait Matchable
class Any

Value members

Concrete methods

def create: Client[F]

Creates a Client.

Creates a Client.

The shutdown of this client is a no-op. Creation of the client allocates no resources, and any resources allocated while using this client are reclaimed by the JVM at its own leisure.

def resource: Resource[F, Client[F]]
def withBlocker(blocker: Blocker): JavaNetClientBuilder[F]
def withConnectTimeout(connectTimeout: Duration): JavaNetClientBuilder[F]
def withHostnameVerifier(hostnameVerifier: HostnameVerifier): JavaNetClientBuilder[F]
def withHostnameVerifierOption(hostnameVerifier: Option[HostnameVerifier]): JavaNetClientBuilder[F]
def withProxy(proxy: Proxy): JavaNetClientBuilder[F]
def withProxyOption(proxy: Option[Proxy]): JavaNetClientBuilder[F]
def withReadTimeout(readTimeout: Duration): JavaNetClientBuilder[F]
def withSslSocketFactory(sslSocketFactory: SSLSocketFactory): JavaNetClientBuilder[F]
def withSslSocketFactoryOption(sslSocketFactory: Option[SSLSocketFactory]): JavaNetClientBuilder[F]

Deprecated methods

@deprecated("Use withBlocker instead", "0.21.0")
def withBlockingExecutionContext(blockingExecutionContext: ExecutionContext): JavaNetClientBuilder[F]
Deprecated

Inherited methods

def allocated: F[(Client[F], F[Unit])]

Returns an effect that allocates a backend and an F[Unit] to release it. The returned F waits until the backend is ready to process requests. The second element of the tuple shuts down the backend when run.

Returns an effect that allocates a backend and an F[Unit] to release it. The returned F waits until the backend is ready to process requests. The second element of the tuple shuts down the backend when run.

Unlike resource and stream, there is no automatic release of the backend. This function is intended for REPL sessions, tests, and other situations where composing a cats.effect.Resource or fs2.Stream is not tenable. resource or stream is recommended wherever possible.

Inherited from
BackendBuilder
def stream: Stream[F, Client[F]]

Returns the backend as a single-element stream. The stream does not emit until the backend is ready to process requests. The backend is shut down when the stream is finalized.

Returns the backend as a single-element stream. The stream does not emit until the backend is ready to process requests. The backend is shut down when the stream is finalized.

Inherited from
BackendBuilder

Concrete fields

val blocker: Blocker
val connectTimeout: Duration
val hostnameVerifier: Option[HostnameVerifier]
val proxy: Option[Proxy]
val readTimeout: Duration
val sslSocketFactory: Option[SSLSocketFactory]