ZClient

zio.http.ZClient
See theZClient companion object
final case class ZClient[-Env, ReqEnv, -In, +Err, +Out](version: Version, url: URL, headers: Headers, sslConfig: Option[ClientSSLConfig], proxy: Option[Proxy], bodyEncoder: BodyEncoder[Env, Err, In], bodyDecoder: BodyDecoder[Env, Err, Out], driver: Driver[Env, ReqEnv, Err])

Attributes

Companion
object
Source
ZClient.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait HeaderChecks[ZClient[Env, ReqEnv, In, Err, Out]]
trait HeaderModifier[ZClient[Env, ReqEnv, In, Err, Out]]
class Object
trait Matchable
class Any
Show all
Self type
ZClient[Env, ReqEnv, In, Err, Out]

Members list

Value members

Concrete methods

def @@[LowerEnv <: UpperEnv, UpperEnv <: Env, LowerIn <: UpperIn, UpperIn <: In, LowerErr >: Err, UpperErr >: LowerErr, LowerOut >: Out, UpperOut >: LowerOut](aspect: ZClientAspect[LowerEnv, UpperEnv, LowerIn, UpperIn, LowerErr, UpperErr, LowerOut, UpperOut]): ZClient[UpperEnv, ReqEnv, UpperIn, LowerErr, LowerOut]

Applies the specified client aspect, which can modify the execution of this client.

Applies the specified client aspect, which can modify the execution of this client.

Attributes

Source
ZClient.scala
def addLeadingSlash: ZClient[Env, ReqEnv, In, Err, Out]

Attributes

Source
ZClient.scala
def addPath(path: String): ZClient[Env, ReqEnv, In, Err, Out]

Attributes

Source
ZClient.scala
def addPath(path: Path): ZClient[Env, ReqEnv, In, Err, Out]

Attributes

Source
ZClient.scala
def addQueryParam(key: String, value: String): ZClient[Env, ReqEnv, In, Err, Out]

Attributes

Source
ZClient.scala
def addQueryParams(params: QueryParams): ZClient[Env, ReqEnv, In, Err, Out]

Attributes

Source
ZClient.scala
def addTrailingSlash: ZClient[Env, ReqEnv, In, Err, Out]

Attributes

Source
ZClient.scala
def addUrl(url: URL): ZClient[Env, ReqEnv, In, Err, Out]

Attributes

Source
ZClient.scala
def apply(request: Request)(implicit ev: Body <:< In, trace: Trace): ZIO[Env & ReqEnv, Err, Out]

Attributes

Source
ZClient.scala
def batched(request: Request)(implicit trace: Trace, ev1: ReqEnv =:= Scope, ev3: Body <:< In): ZIO[Env, Err, Out]

Attributes

Source
ZClient.scala
def batched(implicit ev1: ReqEnv =:= Scope): ZClient[Env, Any, In, Err, Out]

Converts this streaming client into a batched client.

Converts this streaming client into a batched client.

'''NOTE''': This client will materialize the responses into memory. If the response is streaming, it will await for it to be fully collected before resuming.

Attributes

Source
ZClient.scala
def contramap[In2](f: In2 => In)(implicit trace: Trace): ZClient[Env, ReqEnv, In2, Err, Out]

Attributes

Source
ZClient.scala
def contramapZIO[Err1 >: Err, In2](f: In2 => IO[Err1, In]): ZClient[Env, ReqEnv, In2, Err1, Out]

Attributes

Source
ZClient.scala
def delete(suffix: String)(implicit ev: Body <:< In, trace: Trace): ZIO[Env & ReqEnv, Err, Out]

Attributes

Source
ZClient.scala
def dieOn(f: Err => Boolean)(implicit ev1: IsSubtypeOfError[Err, Throwable], ev2: CanFail[Err], trace: Trace): ZClient[Env, ReqEnv, In, Err, Out]

Attributes

Source
ZClient.scala
def get(suffix: String)(implicit ev: Body <:< In, trace: Trace): ZIO[Env & ReqEnv, Err, Out]

Attributes

Source
ZClient.scala
def head(suffix: String)(implicit ev: Body <:< In, trace: Trace): ZIO[Env & ReqEnv, Err, Out]

Attributes

Source
ZClient.scala
def host(host: String): ZClient[Env, ReqEnv, In, Err, Out]

Attributes

Source
ZClient.scala
def map[Out2](f: Out => Out2)(implicit trace: Trace): ZClient[Env, ReqEnv, In, Err, Out2]

Attributes

Source
ZClient.scala
def mapError[Err2](f: Err => Err2): ZClient[Env, ReqEnv, In, Err2, Out]

Attributes

Source
ZClient.scala
def mapZIO[Env1 <: Env, Err1 >: Err, Out2](f: Out => ZIO[Env1, Err1, Out2]): ZClient[Env1, ReqEnv, In, Err1, Out2]

Attributes

Source
ZClient.scala
def patch(suffix: String)(implicit ev: Body <:< In, trace: Trace): ZIO[Env & ReqEnv, Err, Out]

Attributes

Source
ZClient.scala
def path(path: String): ZClient[Env, ReqEnv, In, Err, Out]

Attributes

Source
ZClient.scala
def path(path: Path): ZClient[Env, ReqEnv, In, Err, Out]

Attributes

Source
ZClient.scala
def port(port: Int): ZClient[Env, ReqEnv, In, Err, Out]

Attributes

Source
ZClient.scala
def post(suffix: String)(body: In)(implicit trace: Trace): ZIO[Env & ReqEnv, Err, Out]

Attributes

Source
ZClient.scala
def proxy(proxy: Proxy): ZClient[Env, ReqEnv, In, Err, Out]

Attributes

Source
ZClient.scala
def put(suffix: String)(body: In)(implicit trace: Trace): ZIO[Env & ReqEnv, Err, Out]

Attributes

Source
ZClient.scala
def refineOrDie[Err2](pf: PartialFunction[Err, Err2])(implicit ev1: IsSubtypeOfError[Err, Throwable], ev2: CanFail[Err], trace: Trace): ZClient[Env, ReqEnv, In, Err2, Out]

Attributes

Source
ZClient.scala
def retry[Env1 <: Env](policy: Schedule[Env1, Err, Any]): ZClient[Env1, ReqEnv, In, Err, Out]

Attributes

Source
ZClient.scala
def scheme(scheme: Scheme): ZClient[Env, ReqEnv, In, Err, Out]

Attributes

Source
ZClient.scala
def socket[Env1 <: Env](app: WebSocketApp[Env1])(implicit trace: Trace, ev: ReqEnv =:= Scope): ZIO[Env1 & ReqEnv, Err, Out]

Attributes

Source
ZClient.scala
def ssl(ssl: ClientSSLConfig): ZClient[Env, ReqEnv, In, Err, Out]

Attributes

Source
ZClient.scala
def stream[R, E0 >: Err, A](request: Request)(f: Out => ZStream[R, E0, A])(implicit trace: Trace, ev1: Body <:< In, ev2: ReqEnv =:= Scope): ZStream[R & Env, E0, A]

Executes an HTTP request and transforms the response into a ZStream using the provided function

Executes an HTTP request and transforms the response into a ZStream using the provided function

Attributes

Source
ZClient.scala
def transform[Env2, S2, In2, Err2, Out2](bodyEncoder: BodyEncoder[Env2, Err2, In2], bodyDecoder: BodyDecoder[Env2, Err2, Out2], driver: Driver[Env2, S2, Err2]): ZClient[Env2, S2, In2, Err2, Out2]

Attributes

Source
ZClient.scala
override def updateHeaders(update: Headers => Headers)(implicit trace: Trace): ZClient[Env, ReqEnv, In, Err, Out]

Updates the current Headers with new one, using the provided update function passed.

Updates the current Headers with new one, using the provided update function passed.

Attributes

Definition Classes
Source
ZClient.scala
def updatePath(f: Path => Path): ZClient[Env, ReqEnv, In, Err, Out]

Attributes

Source
ZClient.scala
def updateURL(f: URL => URL): ZClient[Env, ReqEnv, In, Err, Out]

Attributes

Source
ZClient.scala
def uri(uri: URI): ZClient[Env, ReqEnv, In, Err, Out]

Attributes

Source
ZClient.scala
def url(url: URL): ZClient[Env, ReqEnv, In, Err, Out]

Attributes

Source
ZClient.scala

Deprecated methods

def disableStreaming(implicit ev1: ReqEnv =:= Scope): ZClient[Env, Any, In, Err, Out]

Attributes

Deprecated
[Since version 3.0.0] use `batched` instead
Source
ZClient.scala
def request(request: Request)(implicit ev: Body <:< In, trace: Trace): ZIO[Env & ReqEnv, Err, Out]

Attributes

Deprecated
[Since version 3.0.0] Use `batched` or `streaming` instead
Source
ZClient.scala
def request(method: Method, suffix: String)(body: In)(implicit trace: Trace): ZIO[Env & ReqEnv, Err, Out]

Attributes

Deprecated
[Since version 3.0.0] Use `batched` or `streaming` instead
Source
ZClient.scala

Inherited methods

final def addHeader[T](value: T)(implicit schema: Schema[T]): ZClient[Env, ReqEnv, In, Err, Out]

Adds headers based on the given value. The type of the value must have a schema and be a case class and all fields will be added as headers. So fields must be of primitive types (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these. The header names are the field names.

Adds headers based on the given value. The type of the value must have a schema and be a case class and all fields will be added as headers. So fields must be of primitive types (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these. The header names are the field names.

Attributes

Inherited from:
HeaderModifier
Source
HeaderModifier.scala
final def addHeader[T](name: String, value: T)(implicit schema: Schema[T]): ZClient[Env, ReqEnv, In, Err, Out]

Adds a header / headers with the specified name and based on the given value. The value type must have a schema and can be a primitive type (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these.

Adds a header / headers with the specified name and based on the given value. The value type must have a schema and can be a primitive type (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these.

Attributes

Inherited from:
HeaderModifier
Source
HeaderModifier.scala
protected def addHeader(name: CharSequence, value: CharSequence): ZClient[Env, ReqEnv, In, Err, Out]

Attributes

Inherited from:
HeaderModifier
Source
HeaderModifier.scala
final def addHeader(header: Header): ZClient[Env, ReqEnv, In, Err, Out]

Attributes

Inherited from:
HeaderModifier
Source
HeaderModifier.scala
final def addHeaders(headers: Iterable[(CharSequence, CharSequence)]): ZClient[Env, ReqEnv, In, Err, Out]

Attributes

Inherited from:
HeaderModifier
Source
HeaderModifier.scala
final def addHeaders(headers: Headers): ZClient[Env, ReqEnv, In, Err, Out]

Attributes

Inherited from:
HeaderModifier
Source
HeaderModifier.scala
final def hasContentType(mediaType: MediaType): Boolean

Attributes

Inherited from:
HeaderChecks
Source
HeaderChecks.scala
final def hasContentType(value: CharSequence): Boolean

Attributes

Inherited from:
HeaderChecks
Source
HeaderChecks.scala

Attributes

Inherited from:
HeaderChecks
Source
HeaderChecks.scala

Attributes

Inherited from:
HeaderChecks
Source
HeaderChecks.scala
final def hasHeader(header: Header): Boolean

Attributes

Inherited from:
HeaderChecks
Source
HeaderChecks.scala
final def hasHeader(headerType: HeaderType): Boolean

Attributes

Inherited from:
HeaderChecks
Source
HeaderChecks.scala
final def hasHeader(name: CharSequence): Boolean

Attributes

Inherited from:
HeaderChecks
Source
HeaderChecks.scala

Attributes

Inherited from:
HeaderChecks
Source
HeaderChecks.scala

Attributes

Inherited from:
HeaderChecks
Source
HeaderChecks.scala

Attributes

Inherited from:
HeaderChecks
Source
HeaderChecks.scala

Attributes

Inherited from:
HeaderChecks
Source
HeaderChecks.scala
final def header[T](implicit schema: Schema[T]): Either[HeaderError, T]

Retrieves headers as a value of the specified type. The type must have a schema and be a case class and all fields must be headers. So fields must be of primitive types (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these. Headers are selected by field names.

Retrieves headers as a value of the specified type. The type must have a schema and be a case class and all fields must be headers. So fields must be of primitive types (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these. Headers are selected by field names.

Attributes

Inherited from:
HeaderGetters
Source
HeaderGetters.scala
final def header[T](name: String)(implicit schema: Schema[T]): Either[HeaderError, T]

Retrieves the header with the specified name as a value of the specified type. The type must have a schema and can be a primitive type (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these.

Retrieves the header with the specified name as a value of the specified type. The type must have a schema and can be a primitive type (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these.

Attributes

Inherited from:
HeaderGetters
Source
HeaderGetters.scala
final def header(headerType: HeaderType): Option[headerType.HeaderValue]

Gets a header or returns None if the header was not present or it could not be parsed

Gets a header or returns None if the header was not present or it could not be parsed

Attributes

Inherited from:
HeaderGetters
Source
HeaderGetters.scala
final def headerOrElse[T](default: => T)(implicit schema: Schema[T]): T

Retrieves headers as a value of the specified type T, or returns a default value if the headers are not present or could not be parsed. The type T must have a schema and be a case class and all fields must be headers. So fields must be of primitive types (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these. Headers are selected by field names.

Retrieves headers as a value of the specified type T, or returns a default value if the headers are not present or could not be parsed. The type T must have a schema and be a case class and all fields must be headers. So fields must be of primitive types (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these. Headers are selected by field names.

Attributes

Inherited from:
HeaderGetters
Source
HeaderGetters.scala
final def headerOrElse[T](name: String, default: => T)(implicit schema: Schema[T]): T

Retrieves the header with the specified name as a value of the specified type T, or returns a default value if the header is not present or could not be parsed. The type T must have a schema and can be a primitive type (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these.

Retrieves the header with the specified name as a value of the specified type T, or returns a default value if the header is not present or could not be parsed. The type T must have a schema and can be a primitive type (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these.

Attributes

Inherited from:
HeaderGetters
Source
HeaderGetters.scala
final def headerOrFail(headerType: HeaderType): Option[Either[String, headerType.HeaderValue]]

Gets a header. If the header is not present, returns None. If the header could not be parsed it returns the parsing error

Gets a header. If the header is not present, returns None. If the header could not be parsed it returns the parsing error

Attributes

Inherited from:
HeaderGetters
Source
HeaderGetters.scala
final def headerZIO[T](name: String)(implicit schema: Schema[T]): IO[HeaderError, T]

Attributes

Inherited from:
HeaderGetters
Source
HeaderGetters.scala
final def headers(headerType: HeaderType): Chunk[headerType.HeaderValue]

Attributes

Inherited from:
HeaderGetters
Source
HeaderGetters.scala

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product
final def rawHeader(headerType: HeaderType): Option[String]

Gets the raw unparsed header value

Gets the raw unparsed header value

Attributes

Inherited from:
HeaderGetters
Source
HeaderGetters.scala
final def rawHeader(name: CharSequence): Option[String]

Gets the raw unparsed header value

Gets the raw unparsed header value

Attributes

Inherited from:
HeaderGetters
Source
HeaderGetters.scala
def rawHeaders(name: CharSequence): Chunk[String]

Attributes

Inherited from:
HeaderGetters
Source
HeaderGetters.scala
final def removeHeader(name: String): ZClient[Env, ReqEnv, In, Err, Out]

Attributes

Inherited from:
HeaderModifier
Source
HeaderModifier.scala
final def removeHeader(headerType: HeaderType): ZClient[Env, ReqEnv, In, Err, Out]

Attributes

Inherited from:
HeaderModifier
Source
HeaderModifier.scala
final def removeHeaders(headers: Set[String]): ZClient[Env, ReqEnv, In, Err, Out]

Attributes

Inherited from:
HeaderModifier
Source
HeaderModifier.scala
final def setHeaders(headers: Headers): ZClient[Env, ReqEnv, In, Err, Out]

Attributes

Inherited from:
HeaderModifier
Source
HeaderModifier.scala