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

Attributes

Companion
object
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

Add trailing slash to the path.

Add trailing slash to the path.

Attributes

def collect(implicit trace: Trace): ZIO[Any, Throwable, Request]

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

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

Attributes

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

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

Returns all cookies from the request.

Returns all cookies from the request.

Attributes

Drops trailing slash from the path.

Drops trailing slash from the path.

Attributes

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

def ignoreBody(implicit trace: Trace): ZIO[Any, Throwable, Request]

Consumes the streaming body fully and then drops it

Consumes the streaming body fully and then drops it

Attributes

def patch(p: Patch): Request
def path: Path
def path(path: Path): Request

Attributes

Definition Classes
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

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

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

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
def updatePath(f: Path => Path): Request

Attributes

Definition Classes
def updateURL(f: URL => URL): Request
def withBody(body: Body): Request

Returns a request with the specified body.

Returns a request with the specified body.

Attributes

Inherited methods

def ++(that: QueryParams): A

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
final def addHeader(name: CharSequence, value: CharSequence): A

Attributes

Inherited from:
HeaderModifier
final def addHeader(header: Header): A

Attributes

Inherited from:
HeaderModifier
final def addHeaders(headers: Headers): A

Attributes

Inherited from:
HeaderModifier
def addQueryParam(key: String, value: String): A

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

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

Attributes

Inherited from:
QueryModifier
def addQueryParams(values: String): A

Attributes

Inherited from:
QueryModifier
def addQueryParams(key: String, value: Chunk[String]): A

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

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

Attributes

Inherited from:
QueryModifier
final def hasContentType(value: CharSequence): Boolean

Attributes

Inherited from:
HeaderChecks
final def hasFormMultipartContentType: Boolean

Attributes

Inherited from:
HeaderChecks
final def hasFormUrlencodedContentType: Boolean

Attributes

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

Attributes

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

Attributes

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

Attributes

Inherited from:
HeaderChecks
final def hasJsonContentType: Boolean

Attributes

Inherited from:
HeaderChecks
final def hasMediaType(mediaType: MediaType): Boolean

Attributes

Inherited from:
HeaderChecks
def hasQueryParam(name: CharSequence): Boolean

Attributes

Inherited from:
QueryChecks
final def hasTextPlainContentType: Boolean

Attributes

Inherited from:
HeaderChecks
final def hasXhtmlXmlContentType: Boolean

Attributes

Inherited from:
HeaderChecks
final def hasXmlContentType: Boolean

Attributes

Inherited from:
HeaderChecks
final def header(headerType: HeaderType): Option[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
final def headerOrFail(headerType: HeaderType): Option[Either[String, 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
final def headers(headerType: HeaderType): Chunk[HeaderValue]

Attributes

Inherited from:
HeaderGetters
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
def queryParam(key: String): Option[String]

Retrieves the first query parameter value having the specified name.

Retrieves the first query parameter value having the specified name.

Attributes

Inherited from:
QueryGetters
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
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

Inherited from:
QueryGetters
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

Inherited from:
QueryGetters
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

Inherited from:
QueryGetters
def queryParams(key: String): Chunk[String]

Retrieves all query parameter values having the specified name.

Retrieves all query parameter values having the specified name.

Attributes

Inherited from:
QueryGetters
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
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

Inherited from:
QueryGetters
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

Inherited from:
QueryGetters
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

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

Gets the raw unparsed header value

Gets the raw unparsed header value

Attributes

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

Gets the raw unparsed header value

Gets the raw unparsed header value

Attributes

Inherited from:
HeaderGetters
final def removeHeader(name: String): A

Attributes

Inherited from:
HeaderModifier
final def removeHeader(headerType: HeaderType): A

Attributes

Inherited from:
HeaderModifier
final def removeHeaders(headers: Set[String]): A

Attributes

Inherited from:
HeaderModifier
def removeQueryParam(key: String): A

Removes the specified key from the query parameters.

Removes the specified key from the query parameters.

Attributes

Inherited from:
QueryModifier
def removeQueryParams(keys: Iterable[String]): A

Removes the specified keys from the query parameters.

Removes the specified keys from the query parameters.

Attributes

Inherited from:
QueryModifier
final def setHeaders(headers: Headers): A

Attributes

Inherited from:
HeaderModifier
def setQueryParams(queryParams: (String, Chunk[String])*): A

Attributes

Inherited from:
QueryModifier
def setQueryParams(queryParams: Map[String, Chunk[String]]): A

Attributes

Inherited from:
QueryModifier
def setQueryParams(values: String): A

Attributes

Inherited from:
QueryModifier
def setQueryParams(values: QueryParams): A

Attributes

Inherited from:
QueryModifier

Concrete fields

lazy val allHeaders: Headers

Custom headers and headers required by the used Body

Custom headers and headers required by the used Body

Attributes