package tiny_libs

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

Module HttpSource

Sourcetype header = string * string
Sourceval header : string -> header list -> string option
Sourcetype request = {
  1. meth : string;
  2. target : string;
  3. headers : header list;
}
Sourceval get : host:string -> string -> request
Sourceval post : host:string -> content_type:string -> body:string -> string -> request
Sourceval request_to_string : ?body:string -> request -> string
Sourcetype response = {
  1. version : string;
  2. status : int;
  3. reason : string;
  4. headers : header list;
  5. body : string;
}
Sourceval parse_status_line : string -> (string * int * string, string) result
Sourceval dechunk : string -> (string, string) result
Sourceval body : status:int -> header list -> string -> (string, string) result
Sourceval parse_response : string -> (response, string) result
Sourceval is_redirect : int -> bool
Sourcetype parsed_request =
  1. | Incomplete
  2. | Bad of string
  3. | Request of request * string * int
Sourceval parse_request : string -> parsed_request
Sourceval reason : int -> string
Sourceval response : int -> content_type:string -> string -> response
Sourceval response_to_string : response -> string