package yurt

  1. Overview
  2. Docs

Module Yurt.BodySource

The Body module contains methods needed for creating, reading and modifying request data

type t = Cohttp_lwt.Body.t
Sourcetype transfer_encoding = Cohttp.Transfer.encoding
Sourceval to_string : t -> string Lwt.t

Convert body to string

Sourceval to_stream : t -> string Lwt_stream.t

Convert body to stream

Sourceval to_json : t -> Ezjsonm.t Lwt.t

Convert body to JSON

Sourceval of_string : string -> t

Create body from string

Sourceval of_stream : string Lwt_stream.t -> t

Create body from stream

Sourceval of_json : Ezjsonm.t -> t

Create body from JSON

Sourceval map : (string -> string) -> t -> t

Modify body

Sourceval length : t -> (int64 * t) Lwt.t

Get body length

Sourceval is_empty : t -> bool Lwt.t

Returns true when body has no content

Sourceval drain : t -> unit Lwt.t

Ignore body content

Sourceval transfer_encoding : t -> transfer_encoding
OCaml

Innovation. Community. Security.