Module Http.Body

Body of an Http Request

type t
val empty : t

The body will be empty.

val string : string -> string -> t

string media_type s

The body will be the string s. The Content-Type header will be automatically set to the given media_type. For common media types, a.k.a. MIME types, see this list.

val json : Value.t -> t

json v

The body will be v, encoded as json. The Content-Type header will be automatically set to application/json.

val file : File.t -> t

file f The body will be the contents of file f. If the media type of f can be determined using File.media_type, the Content-Type header will be automatically set to that media type.