object Body

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Body
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. final case class ContentType(mediaType: MediaType, boundary: Option[Boundary] = None, charset: Option[Charset] = None) extends Product with Serializable

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. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  6. val empty: Body

    A body that contains no data.

  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. def from[A](a: A)(implicit codec: BinaryCodec[A], trace: Trace): Body

    Constructs a zio.http.Body from a value based on a zio-schema zio.schema.codec.BinaryCodec.
    Example for json:

    Constructs a zio.http.Body from a value based on a zio-schema zio.schema.codec.BinaryCodec.
    Example for json:

    import zio.schema.codec.JsonCodec._
    case class Person(name: String, age: Int)
    implicit val schema: Schema[Person] = DeriveSchema.gen[Person]
    val person = Person("John", 42)
    val body = Body.from(person)
  10. def fromArray(data: Array[Byte]): Body

    Constructs a zio.http.Body from an array of bytes.

    Constructs a zio.http.Body from an array of bytes.

    WARNING: The array must not be mutated after creating the body.

  11. def fromCharSequence(charSequence: CharSequence, charset: Charset = Charsets.Http): Body

    Constructs a zio.http.Body from the contents of a file.

  12. def fromCharSequenceStream(stream: ZStream[Any, Throwable, CharSequence], contentLength: Long, charset: Charset = Charsets.Http)(implicit trace: Trace): Body

    Constructs a zio.http.Body from a stream of text with known length, using the specified character set, which defaults to the HTTP character set.

  13. def fromCharSequenceStreamChunked(stream: ZStream[Any, Throwable, CharSequence], charset: Charset = Charsets.Http)(implicit trace: Trace): Body

    Constructs a zio.http.Body from a stream of text with unknown length using chunked transfer encoding, using the specified character set, which defaults to the HTTP character set.

  14. def fromCharSequenceStreamChunkedEnv[R](stream: ZStream[R, Throwable, CharSequence], charset: Charset = Charsets.Http)(implicit trace: Trace): RIO[R, Body]

    Constructs a zio.http.Body from a stream of text with unknown length using chunked transfer encoding that depends on R, using the specified character set, which defaults to the HTTP character set.

  15. def fromCharSequenceStreamEnv[R](stream: ZStream[R, Throwable, CharSequence], contentLength: Long, charset: Charset = Charsets.Http)(implicit trace: Trace): RIO[R, Body]

    Constructs a zio.http.Body from a stream of text with known length that depends on R, using the specified character set, which defaults to the HTTP character set.

  16. def fromChunk(data: Chunk[Byte], contentType: ContentType): Body
  17. def fromChunk(data: Chunk[Byte], mediaType: MediaType): Body

    Constructs a zio.http.Body from a chunk of bytes and sets the media type.

  18. def fromChunk(data: Chunk[Byte]): Body

    Constructs a zio.http.Body from a chunk of bytes.

  19. def fromFile(file: File, chunkSize: Int = 1024 * 4)(implicit trace: Trace): ZIO[Any, Nothing, Body]

    Constructs a zio.http.Body from the contents of a file.

  20. def fromMultipartForm(form: Form, specificBoundary: Boundary)(implicit trace: Trace): Body

    Constructs a zio.http.Body from from form data, using multipart encoding and the specified character set, which defaults to UTF-8.

  21. def fromMultipartFormUUID(form: Form)(implicit trace: Trace): UIO[Body]

    Constructs a zio.http.Body from from form data, using multipart encoding and the specified character set, which defaults to UTF-8.

    Constructs a zio.http.Body from from form data, using multipart encoding and the specified character set, which defaults to UTF-8. Utilizes a random boundary based on a UUID.

  22. def fromSocketApp(app: WebSocketApp[Any]): WebsocketBody
  23. def fromStream[A](stream: ZStream[Any, Throwable, A])(implicit codec: BinaryCodec[A], trace: Trace): Body

    Constructs a zio.http.Body from stream of values based on a zio-schema zio.schema.codec.BinaryCodec.

    Constructs a zio.http.Body from stream of values based on a zio-schema zio.schema.codec.BinaryCodec.

    Example for json:

    import zio.schema.codec.JsonCodec._
    case class Person(name: String, age: Int)
    implicit val schema: Schema[Person] = DeriveSchema.gen[Person]
    val persons = ZStream(Person("John", 42))
    val body = Body.fromStream(persons)
  24. def fromStream(stream: ZStream[Any, Throwable, Byte], contentLength: Long): Body

    Constructs a zio.http.Body from a stream of bytes with a known length.

  25. def fromStreamChunked(stream: ZStream[Any, Throwable, Byte]): Body

    Constructs a zio.http.Body from a stream of bytes of unknown length, using chunked transfer encoding.

  26. def fromStreamChunkedEnv[R](stream: ZStream[R, Throwable, Byte])(implicit trace: Trace): RIO[R, Body]

    Constructs a zio.http.Body from a stream of bytes of unknown length that depends on R, using chunked transfer encoding.

  27. def fromStreamEnv[A, R](stream: ZStream[R, Throwable, A])(implicit codec: BinaryCodec[A], trace: Trace): RIO[R, Body]

    Constructs a zio.http.Body from stream of values based on a zio-schema zio.schema.codec.BinaryCodec and depends on R

  28. def fromStreamEnv[R](stream: ZStream[R, Throwable, Byte], contentLength: Long)(implicit trace: Trace): RIO[R, Body]

    Constructs a zio.http.Body from a stream of bytes with a known length that depends on R.

  29. def fromString(text: String, charset: Charset = Charsets.Http): Body

    Helper to create Body from String

  30. def fromURLEncodedForm(form: Form, charset: Charset = StandardCharsets.UTF_8): Body

    Constructs a zio.http.Body from form data using URL encoding and the default character set.

  31. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  32. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  33. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  34. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  35. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  36. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  37. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  38. def toString(): String
    Definition Classes
    AnyRef → Any
  39. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  40. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  41. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  42. object ContentType extends Serializable

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 AnyRef

Inherited from Any

Ungrouped