Module Fetch.Body
Body specification and interface.
Specification
val of_uri_params : Brr.Uri.Params.t -> init
of_uri_params p
is a body from URI paramsp
.
val of_form_data : Form.Data.t -> init
of_form_data d
is a body from form datad
.
val of_blob : Brr.Blob.t -> init
of_blob b
is a body from blobb
.
val of_array_buffer : Brr.Tarray.Buffer.t -> init
of_array_buffer b
is a body from array bufferb
.
Interface
type t
The type for objects implementing the
Body
interface.
val array_buffer : t -> Brr.Tarray.Buffer.t Fut.or_error
array_buffer b
readsb
into an array buffer.
val blob : t -> Brr.Blob.t Fut.or_error
blob b
readsb
as a blob.
val form_data : t -> Form.Data.t Fut.or_error
form_data b
readsb
as form data.
val json : t -> Brr.Json.t Fut.or_error
json b
readsb
and parses it as JSON data.
val text : t -> Jstr.t Fut.or_error
text b
readsb
and UTF-8 decodes it to a string.