Packages

final case class Response(status: Status = Status.Ok, headers: Headers = Headers.empty, body: Body = Body.empty) extends HeaderOps[Response] with Product with Serializable

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Response
  2. Serializable
  3. Product
  4. Equals
  5. HeaderOps
  6. HeaderChecks
  7. HeaderGetters
  8. HeaderModifier
  9. AnyRef
  10. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Response(status: Status = Status.Ok, headers: Headers = Headers.empty, body: Body = Body.empty)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addCookie(cookie: Cookie.Response): Response
  5. def addCookies(cookie: Cookie.Response, cookies: Cookie.Response*): Response
  6. def addFlash[A](setter: Setter[A]): Response

    Adds flash values to the cookie-based flash-scope.

  7. final def addHeader[T](value: T)(implicit schema: Schema[T]): Response

    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
  8. final def addHeader[T](name: String, value: T)(implicit schema: Schema[T]): Response

    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
  9. def addHeader(name: CharSequence, value: CharSequence): Response
    Attributes
    protected
    Definition Classes
    HeaderModifier
  10. final def addHeader(header: Header): Response
    Definition Classes
    HeaderModifier
  11. final def addHeaders(headers: Iterable[(CharSequence, CharSequence)]): Response
    Definition Classes
    HeaderModifier
  12. final def addHeaders(headers: Headers): Response
    Definition Classes
    HeaderModifier
  13. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  14. val body: Body
  15. def bodyAs[A](implicit codec: BinaryCodec[A], trace: Trace): Task[A]

    Decodes the content of the body as a value based on a zio-schema zio.schema.codec.BinaryCodec.

    Decodes the content of the body as a value based on a zio-schema zio.schema.codec.BinaryCodec.

    Example for json:

    import zio.schema.json.codec._
    case class Person(name: String, age: Int)
    implicit val schema: Schema[Person] = DeriveSchema.gen[Person]
    val response = ???
    val decodedPerson = response.to[Person]
  16. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  17. def collect(implicit trace: Trace): ZIO[Any, Nothing, Response]

    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

  18. def contentType(mediaType: MediaType): Response
  19. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  21. final def hasContentType(mediaType: MediaType): Boolean
    Definition Classes
    HeaderChecks
  22. final def hasContentType(value: CharSequence): Boolean
    Definition Classes
    HeaderChecks
  23. final def hasFormMultipartContentType: Boolean
    Definition Classes
    HeaderChecks
  24. final def hasFormUrlencodedContentType: Boolean
    Definition Classes
    HeaderChecks
  25. final def hasHeader(header: Header): Boolean
    Definition Classes
    HeaderChecks
  26. final def hasHeader(headerType: HeaderType): Boolean
    Definition Classes
    HeaderChecks
  27. final def hasHeader(name: CharSequence): Boolean
    Definition Classes
    HeaderChecks
  28. final def hasJsonContentType: Boolean
    Definition Classes
    HeaderChecks
  29. final def hasTextPlainContentType: Boolean
    Definition Classes
    HeaderChecks
  30. final def hasXhtmlXmlContentType: Boolean
    Definition Classes
    HeaderChecks
  31. final def hasXmlContentType: Boolean
    Definition Classes
    HeaderChecks
  32. 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
  33. 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
  34. 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
  35. 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
  36. 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
  37. 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
  38. final def headerZIO[T](name: String)(implicit schema: Schema[T]): IO[HeaderError, T]
    Definition Classes
    HeaderGetters
  39. final def headers(headerType: HeaderType): Chunk[HeaderValue]
    Definition Classes
    HeaderGetters
  40. val headers: Headers

    Returns the headers

    Returns the headers

    Definition Classes
    ResponseHeaderGetters
  41. def ignoreBody(implicit trace: Trace): ZIO[Any, Nothing, Response]

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

  42. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  43. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  44. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  45. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  46. def patch(p: Patch)(implicit trace: Trace): Response
  47. def productElementNames: Iterator[String]
    Definition Classes
    Product
  48. final def rawHeader(headerType: HeaderType): Option[String]

    Gets the raw unparsed header value

    Gets the raw unparsed header value

    Definition Classes
    HeaderGetters
  49. final def rawHeader(name: CharSequence): Option[String]

    Gets the raw unparsed header value

    Gets the raw unparsed header value

    Definition Classes
    HeaderGetters
  50. def rawHeaders(name: CharSequence): Chunk[String]
    Definition Classes
    HeaderGetters
  51. final def removeHeader(name: String): Response
    Definition Classes
    HeaderModifier
  52. final def removeHeader(headerType: HeaderType): Response
    Definition Classes
    HeaderModifier
  53. final def removeHeaders(headers: Set[String]): Response
    Definition Classes
    HeaderModifier
  54. final def setHeaders(headers: Headers): Response
    Definition Classes
    HeaderModifier
  55. def status(status: Status): Response

    Sets the status of the response

  56. val status: Status
  57. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  58. def toHandler(implicit trace: Trace): Handler[Any, Nothing, Any, Response]

    Creates an Http from a Response

  59. def updateHeaders(update: (Headers) => Headers)(implicit trace: Trace): Response

    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.

    Definition Classes
    ResponseHeaderModifier
  60. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  61. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  62. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from HeaderOps[Response]

Inherited from HeaderChecks[Response]

Inherited from HeaderGetters

Inherited from HeaderModifier[Response]

Inherited from AnyRef

Inherited from Any

Ungrouped