Module Http_common


module Http_common: sig .. end
Common functionalities shared by other OCaml HTTP modules

val debug : bool Pervasives.ref
whether debugging messages are enabled or not, can be changed at runtime
val debug_print : string -> unit
print a string on stderr only if debugging is enabled
val http_version : Http_types.version
see Http_constants.version
val server_string : string
see Http_constants.server_string
val string_of_version : Http_types.version -> string
pretty print an HTTP version
val version_of_string : string -> Http_types.version
parse an HTTP version from a string
Raises Invalid_HTTP_version if given string doesn't represent a supported HTTP version
val string_of_method : Http_types.meth -> string
pretty print an HTTP method
val method_of_string : string -> Http_types.meth
parse an HTTP method from a string
Raises Invalid_HTTP_method if given string doesn't represent a supported method
val status_of_code : int -> Http_types.status
converts an integer HTTP status to the corresponding status value
Raises Invalid_code if given integer isn't a valid HTTP status code
val code_of_status : [< Http_types.status ] -> int
converts an HTTP status to the corresponding integer value
val is_informational : int -> bool
Returns true on "informational" status codes, false elsewhere
val is_success : int -> bool
Returns true on "success" status codes, false elsewhere
val is_redirection : int -> bool
Returns true on "redirection" status codes, false elsewhere
val is_client_error : int -> bool
Returns true on "client error" status codes, false elsewhere
val is_server_error : int -> bool
Returns true on "server error" status codes, false elsewhere
val is_error : int -> bool
Returns true on "client error" and "server error" status code, false elsewhere