Module Fetch.Body
Body specification and interface.
Specification
val of_jstr : Jstr.t -> Brr_io.Fetch.Body.initof_jstr s is a body from string s.
val of_uri_params : Brr.Uri.Params.t -> Brr_io.Fetch.Body.initof_uri_params p is a body from URI params p.
val of_form_data : Brr_io.Form.Data.t -> Brr_io.Fetch.Body.initof_form_data d is a body from form data d.
val of_blob : Brr.Blob.t -> Brr_io.Fetch.Body.initof_blob b is a body from blob b.
val of_array_buffer : Brr.Tarray.Buffer.t -> Brr_io.Fetch.Body.initof_array_buffer b is a body from array buffer b.
Interface
The type for objects implementing the Body interface.
val body_used : Brr_io.Fetch.Body.t -> boolbody_used b indicates indicates if b was used.
val body : Brr_io.Fetch.Body.t -> Jv.t optionbody b is b as a stream.
val array_buffer : Brr_io.Fetch.Body.t -> Brr.Tarray.Buffer.t Fut.or_errorarray_buffer b reads b into an array buffer.
val blob : Brr_io.Fetch.Body.t -> Brr.Blob.t Fut.or_errorblob b reads b as a blob.
val form_data : Brr_io.Fetch.Body.t -> Brr_io.Form.Data.t Fut.or_errorform_data b reads b as form data.
val json : Brr_io.Fetch.Body.t -> Brr.Json.t Fut.or_errorjson b reads b and parses it as JSON data.
val text : Brr_io.Fetch.Body.t -> Jstr.t Fut.or_errortext b reads b and UTF-8 decodes it to a string.
val to_jv : Brr_io.Fetch.Body.t -> Jv.jvval of_jv : Jv.jv -> Brr_io.Fetch.Body.t