final case class Request(version: Version = Version.Default, method: Method = Method.ANY, url: URL = URL.empty, headers: Headers = Headers.empty, body: Body = Body.empty, remoteAddress: Option[InetAddress] = None, remoteCertificate: Option[Certificate] = None) extends HeaderOps[Request] with QueryOps[Request] with Product with Serializable
- Self Type
- Request
- Alphabetic
- By Inheritance
- Request
- Serializable
- Product
- Equals
- QueryOps
- QueryChecks
- QueryGetters
- QueryModifier
- HeaderOps
- HeaderChecks
- HeaderGetters
- HeaderModifier
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Request(version: Version = Version.Default, method: Method = Method.ANY, url: URL = URL.empty, headers: Headers = Headers.empty, body: Body = Body.empty, remoteAddress: Option[InetAddress] = None, remoteCertificate: Option[Certificate] = None)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def ++(that: Request): Request
A right-biased way of combining two requests.
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.
- def ++(that: QueryParams): Request
Combines two collections of query parameters together.
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.
- Definition Classes
- QueryModifier
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def addCookie(cookie: Cookie.Request): Request
- def addCookies(cookie: Cookie.Request, cookies: Cookie.Request*): Request
- final def addHeader[T](value: T)(implicit schema: Schema[T]): Request
Adds headers based on the given value.
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.
- Definition Classes
- HeaderModifier
- 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.
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.
- Definition Classes
- HeaderModifier
- def addHeader(name: CharSequence, value: CharSequence): Request
- Attributes
- protected
- Definition Classes
- HeaderModifier
- final def addHeader(header: Header): Request
- Definition Classes
- HeaderModifier
- final def addHeaders(headers: Iterable[(CharSequence, CharSequence)]): Request
- Definition Classes
- HeaderModifier
- final def addHeaders(headers: Headers): Request
- Definition Classes
- HeaderModifier
- def addLeadingSlash: Request
- def addQueryParam[T](value: T)(implicit schema: Schema[T]): Request
- Definition Classes
- QueryModifier
- def addQueryParam[T](key: String, value: T)(implicit schema: Schema[T]): Request
- Definition Classes
- QueryModifier
- def addQueryParam(key: String): Request
- Definition Classes
- QueryModifier
- 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.
- Definition Classes
- QueryModifier
- def addQueryParams(queryParams: Iterable[(String, String)]): Request
- Definition Classes
- QueryModifier
- def addQueryParams(values: String): Request
- Definition Classes
- QueryModifier
- 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.
- Definition Classes
- QueryModifier
- def addTrailingSlash: Request
Add trailing slash to the path.
- val allHeaders: Headers
Custom headers and headers required by the used Body
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val body: Body
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- 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
- def cookie(name: String): Option[Cookie]
Returns the cookie with the given name if it exists.
- 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
fwith the cookie afterwards.Uses the cookie with the given name if it exists and runs
fwith the cookie afterwards.Also, you can set a custom failure value from a missing cookie with
E. - 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
fwith the cookie afterwards. - def cookies: Chunk[Cookie]
Returns all cookies from the request.
- def dropLeadingSlash: Request
- def dropTrailingSlash: Request
Drops trailing slash from the path.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def flash[A](flash: Flash[A]): Option[A]
Returns an
Aif it exists from the cookie-based flash-scope. - final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def hasContentType(mediaType: MediaType): Boolean
- Definition Classes
- HeaderChecks
- final def hasContentType(value: CharSequence): Boolean
- Definition Classes
- HeaderChecks
- final def hasFormMultipartContentType: Boolean
- Definition Classes
- HeaderChecks
- final def hasFormUrlencodedContentType: Boolean
- Definition Classes
- HeaderChecks
- final def hasHeader(header: Header): Boolean
- Definition Classes
- HeaderChecks
- final def hasHeader(headerType: HeaderType): Boolean
- Definition Classes
- HeaderChecks
- final def hasHeader(name: CharSequence): Boolean
- Definition Classes
- HeaderChecks
- final def hasJsonContentType: Boolean
- Definition Classes
- HeaderChecks
- def hasQueryParam(name: CharSequence): Boolean
- Definition Classes
- QueryChecks
- final def hasTextPlainContentType: Boolean
- Definition Classes
- HeaderChecks
- final def hasXhtmlXmlContentType: Boolean
- Definition Classes
- HeaderChecks
- final def hasXmlContentType: Boolean
- Definition Classes
- HeaderChecks
- final def header[T](implicit schema: Schema[T]): Either[HeaderError, T]
Retrieves headers as a value of the specified type.
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.
- Definition Classes
- HeaderGetters
- 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.
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.
- Definition Classes
- HeaderGetters
- 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
- Definition Classes
- HeaderGetters
- 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.
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.
- Definition Classes
- HeaderGetters
- 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.
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.
- Definition Classes
- HeaderGetters
- final def headerOrFail(headerType: HeaderType): Option[Either[String, HeaderValue]]
Gets a header.
Gets a header. If the header is not present, returns None. If the header could not be parsed it returns the parsing error
- Definition Classes
- HeaderGetters
- final def headerZIO[T](name: String)(implicit schema: Schema[T]): IO[HeaderError, T]
- Definition Classes
- HeaderGetters
- final def headers(headerType: HeaderType): Chunk[HeaderValue]
- Definition Classes
- HeaderGetters
- val headers: Headers
Returns the headers
Returns the headers
- Definition Classes
- Request → HeaderGetters
- def ignoreBody(implicit trace: Trace): ZIO[Any, Nothing, Request]
Consumes the streaming body fully and then discards it while also ignoring any failures
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val method: Method
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- def patch(p: Patch): Request
- def path(path: Path): Request
- def path: Path
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def query[T](implicit schema: Schema[T]): Either[QueryParamError, T]
Retrieves query parameters as a value of the specified type.
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.
- Definition Classes
- QueryGetters
- 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.
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.
- Definition Classes
- QueryGetters
- def queryOrElse[T](default: => T)(implicit schema: Schema[T]): T
- Definition Classes
- QueryGetters
- def queryOrElse[T](key: String, default: => T)(implicit schema: Schema[T]): T
- Definition Classes
- QueryGetters
- 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.
- Definition Classes
- 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.
- Definition Classes
- QueryGetters
- def queryParameters: QueryParams
- Definition Classes
- Request → 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.
- Definition Classes
- 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.
- Definition Classes
- QueryGetters
- 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
- Definition Classes
- QueryGetters
- final def rawHeader(headerType: HeaderType): Option[String]
Gets the raw unparsed header value
Gets the raw unparsed header value
- Definition Classes
- HeaderGetters
- final def rawHeader(name: CharSequence): Option[String]
Gets the raw unparsed header value
Gets the raw unparsed header value
- Definition Classes
- HeaderGetters
- def rawHeaders(name: CharSequence): Chunk[String]
- Definition Classes
- HeaderGetters
- val remoteAddress: Option[InetAddress]
- val remoteCertificate: Option[Certificate]
- final def removeHeader(name: String): Request
- Definition Classes
- HeaderModifier
- final def removeHeader(headerType: HeaderType): Request
- Definition Classes
- HeaderModifier
- final def removeHeaders(headers: Set[String]): Request
- Definition Classes
- HeaderModifier
- def removeQueryParam(key: String): Request
Removes the specified key from the query parameters.
Removes the specified key from the query parameters.
- Definition Classes
- QueryModifier
- def removeQueryParams(keys: Iterable[String]): Request
Removes the specified keys from the query parameters.
Removes the specified keys from the query parameters.
- Definition Classes
- QueryModifier
- final def setHeaders(headers: Headers): Request
- Definition Classes
- HeaderModifier
- def setQueryParams(queryParams: (String, Chunk[String])*): Request
- Definition Classes
- QueryModifier
- def setQueryParams(queryParams: Map[String, Chunk[String]]): Request
- Definition Classes
- QueryModifier
- def setQueryParams(values: String): Request
- Definition Classes
- QueryModifier
- def setQueryParams(values: QueryParams): Request
- Definition Classes
- QueryModifier
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def unnest(prefix: Path): Request
Unnests the request by the specified prefix.
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.
- def updateBody(f: (Body) => Body): Request
Returns a request with a body derived from the current body.
- 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.
- def updateHeaders(update: (Headers) => Headers)(implicit trace: Trace): Request
Updates the headers using the provided function
Updates the headers using the provided function
- Definition Classes
- Request → HeaderModifier
- def updatePath(f: (Path) => Path): Request
- def updateQueryParams(f: (QueryParams) => QueryParams): Request
- Definition Classes
- Request → QueryModifier
- def updateURL(f: (URL) => URL): Request
- val url: URL
- def valueCount(name: CharSequence): Int
- Definition Classes
- QueryChecks
- val version: Version
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def withBody(body: Body): Request
Returns a request with the specified body.
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)
- 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.
- Definition Classes
- QueryGetters
- Annotations
- @deprecated
- Deprecated
(Since version 3.1.0) Use query(key)[T]
- 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.
- Definition Classes
- QueryGetters
- Annotations
- @deprecated
- Deprecated
(Since version 3.1.0) Use queryParamOrElse(key, default)
- 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.
- Definition Classes
- QueryGetters
- Annotations
- @deprecated
- Deprecated
(Since version 3.1.0) Use queryZIO(key)[T]
- 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.
- Definition Classes
- QueryGetters
- Annotations
- @deprecated
- Deprecated
(Since version 3.1.0) Use query(key)[Chunk[T]
- 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.
- Definition Classes
- QueryGetters
- Annotations
- @deprecated
- Deprecated
(Since version 3.1.0) Use queryParamsOrElse(key, default)
- 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.
- Definition Classes
- QueryGetters
- Annotations
- @deprecated
- Deprecated
(Since version 3.1.0) Use queryZIO(key)[Chunk[T]