package tiny_libs

  1. Overview
  2. Docs
From-scratch libraries for teaching: graphics, audio, compression, crypto, networking and more

Install

dune-project
 Dependency

Authors

Maintainers

Sources

0.3.6.tar.gz
md5=7c636383d146d30ac6f2fa234a6253c8
sha512=c79f3823c5f8f57e5038eb640d487c61168b84aa07c61999d6622ef9fd0c890e2b03b4c6a7cdbbe9352a49e25dda00ac7bb14693cee8e3d7beeed251351a2af0

doc/tiny_libs.networking_protocols/Http/index.html

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