package brr

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Fetch.BodySource

Body specification and interface.

Specification

Sourcetype init

The type for specifying bodies.

Sourceval of_jstr : Jstr.t -> init

of_jstr s is a body from string s.

Sourceval of_uri_params : Brr.Uri.Params.t -> init

of_uri_params p is a body from URI params p.

Sourceval of_form_data : Form.Data.t -> init

of_form_data d is a body from form data d.

Sourceval of_blob : Brr.Blob.t -> init

of_blob b is a body from blob b.

Sourceval of_array_buffer : Brr.Tarray.Buffer.t -> init

of_array_buffer b is a body from array buffer b.

Interface

Sourcetype t

The type for objects implementing the Body interface.

Sourceval body_used : t -> bool

body_used b indicates indicates if b was used.

Sourceval 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.

Sourceval form_data : t -> Form.Data.t Fut.or_error

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.