jon.recoil.org

Module Fetch.Body

Body specification and interface.

Specification

type init

The type for specifying bodies.

of_jstr s is a body from string s.

of_uri_params p is a body from URI params p.

of_form_data d is a body from form data d.

of_blob b is a body from blob b.

of_array_buffer b is a body from array buffer b.

Interface

type t

The type for objects implementing the Body interface.

val body_used : Brr_io.Fetch.Body.t -> bool

body_used b indicates indicates if b was used.

val body : Brr_io.Fetch.Body.t -> Jv.t option

body b is b as a stream.

array_buffer b reads b into an array buffer.

blob b reads b as a blob.

form_data b reads b as form data.

json b reads b and parses it as JSON data.

text b reads b and UTF-8 decodes it to a string.

val to_jv : Brr_io.Fetch.Body.t -> Jv.jv
val of_jv : Jv.jv -> Brr_io.Fetch.Body.t