Module Fetch.Body

Body specification and interface.

val array_buffer : ?abort:Brr.Abort.t -> Brr_io.Fetch.Body.t -> Brr.Tarray.Buffer.t

array_buffer ?abort b reads b into an array buffer. If the fiber is cancelled, the optional controller abort is aborted. This only cancels the operation if the signal of abort was passed to the request that produced b (see the example after request).

val blob : ?abort:Brr.Abort.t -> Brr_io.Fetch.Body.t -> Brr.Blob.t

blob ?abort b reads b as a blob. If the fiber is cancelled, the optional controller abort is aborted. This only cancels the operation if the signal of abort was passed to the request that produced b (see the example after request).

val form_data : ?abort:Brr.Abort.t -> Brr_io.Fetch.Body.t -> Brr_io.Form.Data.t

form_data ?abort b reads b as form data. If the fiber is cancelled, the optional controller abort is aborted. This only cancels the operation if the signal of abort was passed to the request that produced b (see the example after request).

val json : ?abort:Brr.Abort.t -> Brr_io.Fetch.Body.t -> Brr.Json.t

json ?abort b reads b and parses it as JSON data. If the fiber is cancelled, the optional controller abort is aborted. This only cancels the operation if the signal of abort was passed to the request that produced b (see the example after request).

val text : ?abort:Brr.Abort.t -> Brr_io.Fetch.Body.t -> Jstr.t

text ?abort b reads b and UTF-8 decodes it to a string. If the fiber is cancelled, the optional controller abort is aborted. This only cancels the operation if the signal of abort was passed to the request that produced b (see the example after request).