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. All

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( ... ) @native() @IntrinsicCandidate()
  6. val empty: Body

    A body that contains no data.

  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): 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 fromChunk(data: Chunk[Byte], mediaType: MediaType): Body

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

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

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

  16. 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.

  17. 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.

  18. 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.

  19. def fromSocketApp(app: WebSocketApp[Any]): WebsocketBody
  20. 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)
  21. def fromStream(stream: ZStream[Any, Throwable, Byte], contentLength: Long): Body

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

  22. 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.

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

    Helper to create Body from String

  24. 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.

  25. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  26. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  27. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  28. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  29. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  30. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  31. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  32. def toString(): String
    Definition Classes
    AnyRef → Any
  33. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  35. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

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

Inherited from AnyRef

Inherited from Any

Ungrouped