case class FetchBody(content: ReadableStream[Uint8Array], mediaType: Option[MediaType], boundary: Option[Boundary]) extends Body with Product with Serializable
- Alphabetic
- By Inheritance
- FetchBody
- Serializable
- Serializable
- Product
- Equals
- Body
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new FetchBody(content: ReadableStream[Uint8Array], mediaType: Option[MediaType], boundary: Option[Boundary])
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
++(that: Body): Body
A right-biased way of combining two bodies.
A right-biased way of combining two bodies. If either body is empty, the other will be returned. Otherwise, the right body will be returned.
- Definition Classes
- Body
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
asArray(implicit trace: Trace): Task[Array[Byte]]
Returns an effect that decodes the content of the body as array of bytes.
-
def
asChunk(implicit trace: Trace): Task[Chunk[Byte]]
Returns an effect that decodes the content of the body as a chunk of bytes.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
asMultipartForm(implicit trace: Trace): Task[Form]
Returns an effect that decodes the content of the body as a multipart form.
Returns an effect that decodes the content of the body as a multipart form. Note that attempting to decode a large stream of bytes into a form could result in an out of memory error.
- Definition Classes
- Body
-
def
asMultipartFormStream(implicit trace: Trace): Task[StreamingForm]
Returns an effect that decodes the streaming body as a multipart form.
Returns an effect that decodes the streaming body as a multipart form.
The result is a stream of FormField objects, where each FormField may be a StreamingBinary or a Text object. The StreamingBinary object contains a stream of bytes, which has to be consumed asynchronously by the user to get the next FormField from the stream.
- Definition Classes
- Body
-
def
asMultipartMixed(implicit trace: Trace): Task[MultipartMixed]
Returns an effect that decodes the streaming body as a multipart/mixed.
Returns an effect that decodes the streaming body as a multipart/mixed.
The result is a stream of Part objects, where each Part has headers and contents (binary stream), Part objects can be easily converted to a Body objects which provide vast API for extracting their contents.
- Definition Classes
- Body
-
def
asStream(implicit trace: Trace): ZStream[Any, Throwable, Byte]
Returns a stream that contains the bytes of the body.
-
final
def
asString(charset: Charset)(implicit trace: Trace): Task[String]
Decodes the content of the body as a string with the provided charset.
Decodes the content of the body as a string with the provided charset. Note that attempting to decode a large stream of bytes into a string could result in an out of memory error.
- Definition Classes
- Body
-
final
def
asString(implicit trace: Trace): Task[String]
Decodes the content of the body as a string with the default charset.
Decodes the content of the body as a string with the default charset. Note that attempting to decode a large stream of bytes into a string could result in an out of memory error.
- Definition Classes
- Body
-
def
asURLEncodedForm(implicit trace: Trace): Task[Form]
Returns an effect that decodes the content of the body as form data.
Returns an effect that decodes the content of the body as form data.
- Definition Classes
- Body
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @IntrinsicCandidate()
- val content: ReadableStream[Uint8Array]
- def contentType(newMediaType: MediaType, newBoundary: Boundary): Body
-
def
contentType(newMediaType: MediaType): Body
Updates the media type attached to this body, returning a new Body with the updated media type
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
-
def
isComplete: Boolean
Returns whether or not the bytes of the body have been fully read.
-
def
isEmpty: Boolean
Returns whether or not the body is known to be empty.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
knownContentLength: Option[Long]
Returns whether or not the content length is known
-
val
mediaType: Option[MediaType]
Returns the media type for this Body
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
to[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 person = Person("John", 42) val body = Body.from(person) val decodedPerson = body.to[Person]
- Definition Classes
- Body
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )