Module Httpun_common

type 'content with_headers = {
  1. content : 'content;
  2. headers : (string * string) list;
}
type _ response =
  1. | Simple : string response
  2. | WithHeaders : string with_headers response
type http_error = [
  1. | `http of int * string
]
type perform_error = [
  1. | `msg of string
  2. | `exn of exn
  3. | `timeout of float
  4. | `invalid_url of string
]
type stream_error_base = [
  1. | `interval_timeout of float
  2. | `exn of exn
  3. | http_error
]
type 'e stream_error = [
  1. | stream_error_base
  2. | `cb of 'e
]
val log : ?meth:string -> string -> string option -> unit
val pp_error : Stdlib.Format.formatter -> [< error ] -> unit
val error_handler : (('a, [> `exn of 'b | `msg of string ]) Stdlib.result -> 'c) -> [< `Exn of 'b | `Invalid_response_body_length of 'd | `Malformed_response of string ] -> 'c
val parse : string -> (string * string * int * string, [> `invalid_url of string ]) Stdlib.result
val response_handler : 'r. ?msg:string -> res:'r response -> url:string -> (('r, [> http_error ]) Stdlib.result -> unit) -> Httpun.Response.t -> Httpun.Body.Reader.t -> unit