Request

zio.http.Request
See theRequest companion object
final case class Request(version: Version = ..., method: Method = ..., url: URL = ..., headers: Headers = ..., body: Body = ..., remoteAddress: Option[InetAddress] = ..., remoteCertificate: Option[Certificate] = ...)

Attributes

Companion
object
Source
Request.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type

Members list

Value members

Concrete methods

def ++(that: Request): Request

A right-biased way of combining two requests. Most information will be merged, but in cases where this does not make sense (e.g. two non-empty bodies), the information from the right request will be used.

A right-biased way of combining two requests. Most information will be merged, but in cases where this does not make sense (e.g. two non-empty bodies), the information from the right request will be used.

Attributes

Source
Request.scala
def addCookie(cookie: Request): Request

Attributes

Source
Request.scala
def addCookies(cookie: Request, cookies: Request*): Request

Attributes

Source
Request.scala

Attributes

Source
Request.scala

Add trailing slash to the path.

Add trailing slash to the path.

Attributes

Source
Request.scala
def collect(implicit trace: Trace): ZIO[Any, Nothing, Request]

Collects the potentially streaming body of the response into a single chunk.

Collects the potentially streaming body of the response into a single chunk.

Any errors that occur from the collection of the body will be caught and propagated to the Body

Attributes

Source
Request.scala
def cookieWithOrFail[R, E, A](name: String)(missingCookieError: E)(f: Cookie => ZIO[R, E, A])(implicit trace: Trace): ZIO[R, E, A]

Uses the cookie with the given name if it exists and runs f with the cookie afterwards.

Uses the cookie with the given name if it exists and runs f with the cookie afterwards.

Also, you can set a custom failure value from a missing cookie with E.

Attributes

Source
Request.scala
def cookieWithZIO[R, A](name: String)(f: Cookie => ZIO[R, Throwable, A])(implicit trace: Trace): ZIO[R, Throwable, A]

Uses the cookie with the given name if it exists and runs f with the cookie afterwards.

Uses the cookie with the given name if it exists and runs f with the cookie afterwards.

Attributes

Source
Request.scala

Returns all cookies from the request.

Returns all cookies from the request.

Attributes

Source
Request.scala

Attributes

Source
Request.scala

Drops trailing slash from the path.

Drops trailing slash from the path.

Attributes

Source
Request.scala
def flash[A](flash: Flash[A]): Option[A]

Returns an A if it exists from the cookie-based flash-scope.

Returns an A if it exists from the cookie-based flash-scope.

Attributes

Source
Request.scala
def ignoreBody(implicit trace: Trace): ZIO[Any, Nothing, Request]

Consumes the streaming body fully and then discards it while also ignoring any failures

Consumes the streaming body fully and then discards it while also ignoring any failures

Attributes

Source
Request.scala
def patch(p: Patch): Request

Attributes

Source
Request.scala
def path: Path

Attributes

Source
Request.scala
def path(path: Path): Request

Attributes

Source
Request.scala

Attributes

Definition Classes
Source
Request.scala
def unnest(prefix: Path): Request

Unnests the request by the specified prefix. If the request URL is not nested at the specified path, then this has no effect on the URL.

Unnests the request by the specified prefix. If the request URL is not nested at the specified path, then this has no effect on the URL.

Attributes

Source
Request.scala
def updateBody(f: Body => Body): Request

Returns a request with a body derived from the current body.

Returns a request with a body derived from the current body.

Attributes

Source
Request.scala
def updateBodyZIO[R, E](f: Body => ZIO[R, E, Body]): ZIO[R, E, Request]

Returns a request with a body derived from the current body in an effectful way.

Returns a request with a body derived from the current body in an effectful way.

Attributes

Source
Request.scala
override def updateHeaders(update: Headers => Headers)(implicit trace: Trace): Request

Updates the headers using the provided function

Updates the headers using the provided function

Attributes

Definition Classes
Source
Request.scala
def updatePath(f: Path => Path): Request

Attributes

Source
Request.scala

Attributes

Definition Classes
Source
Request.scala
def updateURL(f: URL => URL): Request

Attributes

Source
Request.scala
def withBody(body: Body): Request

Returns a request with the specified body.

Returns a request with the specified body.

Attributes

Source
Request.scala

Inherited methods

def ++(that: QueryParams): Request

Combines two collections of query parameters together. If there are duplicate keys, the values from both sides are preserved, in order from left-to-right.

Combines two collections of query parameters together. If there are duplicate keys, the values from both sides are preserved, in order from left-to-right.

Attributes

Inherited from:
QueryModifier
Source
QueryModifier.scala
final def addHeader[T](value: T)(implicit schema: Schema[T]): Request

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]): Request

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): Request

Attributes

Inherited from:
HeaderModifier
Source
HeaderModifier.scala
final def addHeader(header: Header): Request

Attributes

Inherited from:
HeaderModifier
Source
HeaderModifier.scala
final def addHeaders(headers: Iterable[(CharSequence, CharSequence)]): Request

Attributes

Inherited from:
HeaderModifier
Source
HeaderModifier.scala
final def addHeaders(headers: Headers): Request

Attributes

Inherited from:
HeaderModifier
Source
HeaderModifier.scala
def addQueryParam[T](value: T)(implicit schema: Schema[T]): Request

Attributes

Inherited from:
QueryModifier
Source
QueryModifier.scala
def addQueryParam[T](key: String, value: T)(implicit schema: Schema[T]): Request

Attributes

Inherited from:
QueryModifier
Source
QueryModifier.scala

Attributes

Inherited from:
QueryModifier
Source
QueryModifier.scala
def addQueryParam(key: String, value: String): Request

Adds the specified key/value pair to the query parameters.

Adds the specified key/value pair to the query parameters.

Attributes

Inherited from:
QueryModifier
Source
QueryModifier.scala
def addQueryParams(queryParams: Iterable[(String, String)]): Request

Attributes

Inherited from:
QueryModifier
Source
QueryModifier.scala
def addQueryParams(values: String): Request

Attributes

Inherited from:
QueryModifier
Source
QueryModifier.scala
def addQueryParams(key: String, value: Chunk[String]): Request

Adds the specified key/value pairs to the query parameters.

Adds the specified key/value pairs to the query parameters.

Attributes

Inherited from:
QueryModifier
Source
QueryModifier.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
def hasQueryParam(name: CharSequence): Boolean

Attributes

Inherited from:
QueryChecks
Source
QueryChecks.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
def query[T](implicit schema: Schema[T]): Either[QueryParamError, T]

Retrieves query parameters as a value of the specified type. The type must have a schema and be a case class and all fields must be query parameters. 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. Query parameters are selected by field names.

Retrieves query parameters as a value of the specified type. The type must have a schema and be a case class and all fields must be query parameters. 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. Query parameters are selected by field names.

Attributes

Inherited from:
QueryGetters
Source
QueryGetters.scala
def query[T](key: String)(implicit schema: Schema[T]): Either[QueryParamError, T]

Retrieves the query parameter 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 query parameter 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:
QueryGetters
Source
QueryGetters.scala
def queryOrElse[T](default: => T)(implicit schema: Schema[T]): T

Attributes

Inherited from:
QueryGetters
Source
QueryGetters.scala
def queryOrElse[T](key: String, default: => T)(implicit schema: Schema[T]): T

Attributes

Inherited from:
QueryGetters
Source
QueryGetters.scala

Retrieves the first query parameter value having the specified name.

Retrieves the first query parameter value having the specified name.

Attributes

Inherited from:
QueryGetters
Source
QueryGetters.scala
def queryParamOrElse(key: String, default: => String): String

Retrieves the first query parameter value having the specified name, or else uses the default value.

Retrieves the first query parameter value having the specified name, or else uses the default value.

Attributes

Inherited from:
QueryGetters
Source
QueryGetters.scala

Retrieves all query parameter values having the specified name.

Retrieves all query parameter values having the specified name.

Attributes

Inherited from:
QueryGetters
Source
QueryGetters.scala
def queryParamsOrElse(key: String, default: => Iterable[String]): Chunk[String]

Retrieves all query parameter values having the specified name, or else uses the default iterable.

Retrieves all query parameter values having the specified name, or else uses the default iterable.

Attributes

Inherited from:
QueryGetters
Source
QueryGetters.scala
def queryZIO[T](key: String)(implicit schema: Schema[T]): IO[QueryParamError, T]

Retrieves all typed query parameter values having the specified name as ZIO

Retrieves all typed query parameter values having the specified name as ZIO

Attributes

Inherited from:
QueryGetters
Source
QueryGetters.scala
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): Request

Attributes

Inherited from:
HeaderModifier
Source
HeaderModifier.scala
final def removeHeader(headerType: HeaderType): Request

Attributes

Inherited from:
HeaderModifier
Source
HeaderModifier.scala
final def removeHeaders(headers: Set[String]): Request

Attributes

Inherited from:
HeaderModifier
Source
HeaderModifier.scala

Removes the specified key from the query parameters.

Removes the specified key from the query parameters.

Attributes

Inherited from:
QueryModifier
Source
QueryModifier.scala

Removes the specified keys from the query parameters.

Removes the specified keys from the query parameters.

Attributes

Inherited from:
QueryModifier
Source
QueryModifier.scala
final def setHeaders(headers: Headers): Request

Attributes

Inherited from:
HeaderModifier
Source
HeaderModifier.scala
def setQueryParams(queryParams: (String, Chunk[String])*): Request

Attributes

Inherited from:
QueryModifier
Source
QueryModifier.scala
def setQueryParams(queryParams: Map[String, Chunk[String]]): Request

Attributes

Inherited from:
QueryModifier
Source
QueryModifier.scala
def setQueryParams(values: String): Request

Attributes

Inherited from:
QueryModifier
Source
QueryModifier.scala

Attributes

Inherited from:
QueryModifier
Source
QueryModifier.scala
def valueCount(name: CharSequence): Int

Attributes

Inherited from:
QueryChecks
Source
QueryChecks.scala

Deprecated and Inherited methods

def queryParamTo[T](key: String)(implicit codec: TextCodec[T]): Either[QueryParamsError, T]

Retrieves the first typed query parameter value having the specified name.

Retrieves the first typed query parameter value having the specified name.

Attributes

Deprecated
[Since version 3.1.0] Use query(key)[T]
Inherited from:
QueryGetters
Source
QueryGetters.scala
def queryParamToOrElse[T](key: String, default: => T)(implicit codec: TextCodec[T]): T

Retrieves the first typed query parameter value having the specified name, or else uses the default value.

Retrieves the first typed query parameter value having the specified name, or else uses the default value.

Attributes

Deprecated
[Since version 3.1.0] Use queryParamOrElse(key, default)
Inherited from:
QueryGetters
Source
QueryGetters.scala
def queryParamToZIO[T](key: String)(implicit codec: TextCodec[T]): IO[QueryParamsError, T]

Retrieves the first typed query parameter value having the specified name as ZIO.

Retrieves the first typed query parameter value having the specified name as ZIO.

Attributes

Deprecated
[Since version 3.1.0] Use queryZIO(key)[T]
Inherited from:
QueryGetters
Source
QueryGetters.scala
def queryParamsTo[T](key: String)(implicit codec: TextCodec[T]): Either[QueryParamsError, Chunk[T]]

Retrieves all typed query parameter values having the specified name.

Retrieves all typed query parameter values having the specified name.

Attributes

Deprecated
[Since version 3.1.0] Use query(key)[Chunk[T]
Inherited from:
QueryGetters
Source
QueryGetters.scala
def queryParamsToOrElse[T](key: String, default: => Iterable[T])(implicit codec: TextCodec[T]): Chunk[T]

Retrieves all query parameter values having the specified name, or else uses the default iterable.

Retrieves all query parameter values having the specified name, or else uses the default iterable.

Attributes

Deprecated
[Since version 3.1.0] Use queryParamsOrElse(key, default)
Inherited from:
QueryGetters
Source
QueryGetters.scala
def queryParamsToZIO[T](key: String)(implicit codec: TextCodec[T]): IO[QueryParamsError, Chunk[T]]

Retrieves all typed query parameter values having the specified name as ZIO.

Retrieves all typed query parameter values having the specified name as ZIO.

Attributes

Deprecated
[Since version 3.1.0] Use queryZIO(key)[Chunk[T]
Inherited from:
QueryGetters
Source
QueryGetters.scala

Concrete fields

Custom headers and headers required by the used Body

Custom headers and headers required by the used Body

Attributes

Source
Request.scala