`sig
type protocol_version = int * int
type protocol_attribute = [ `Secure_https ]
type protocol =
[ `Http of Nethttp.protocol_version * Nethttp.protocol_attribute list
| `Other ]
val string_of_protocol : Nethttp.protocol -> string
val protocol_of_string : string -> Nethttp.protocol
type http_status =
[ `Accepted
| `Bad_gateway
| `Bad_request
| `Conflict
| `Continue
| `Created
| `Expectation_failed
| `Forbidden
| `Found
| `Gateway_timeout
| `Gone
| `Http_version_not_supported
| `Internal_server_error
| `Length_required
| `Method_not_allowed
| `Moved_permanently
| `Multiple_choices
| `No_content
| `Non_authoritative
| `Not_acceptable
| `Not_found
| `Not_implemented
| `Not_modified
| `Ok
| `Partial_content
| `Payment_required
| `Precondition_failed
| `Proxy_auth_required
| `Request_entity_too_large
| `Request_timeout
| `Request_uri_too_long
| `Requested_range_not_satisfiable
| `Reset_content
| `See_other
| `Service_unavailable
| `Switching_protocols
| `Temporary_redirect
| `Unauthorized
| `Unsupported_media_type
| `Use_proxy ]
val int_of_http_status : Nethttp.http_status -> int
val http_status_of_int : int -> Nethttp.http_status
val string_of_http_status : Nethttp.http_status -> string
val base_code : int -> int
type http_method = string * string
type cache_control_token =
[ `Extension of string * string option
| `Max_age of int
| `Max_stale of int option
| `Min_fresh of int
| `Must_revalidate
| `No_cache of string list
| `No_store
| `No_transform
| `Only_if_cached
| `Private of string list
| `Proxy_revalidate
| `Public
| `S_maxage of int ]
type etag = [ `Strong of string | `Weak of string ]
val weak_validator_match : Nethttp.etag -> Nethttp.etag -> bool
val strong_validator_match : Nethttp.etag -> Nethttp.etag -> bool
exception Bad_header_field of string
class type http_header = Netmime.mime_header
class type http_header_ro = Netmime.mime_header_ro
class type http_trailer = Netmime.mime_header
class type http_trailer_ro = Netmime.mime_header_ro
val status_of_cgi_header : Nethttp.http_header -> int * string
type netscape_cookie = {
cookie_name : string;
cookie_value : string;
cookie_expires : float option;
cookie_domain : string option;
cookie_path : string option;
cookie_secure : bool;
}
type cookie = Nethttp.netscape_cookie
val decode_query : string -> string * string
val split_host_port : string -> string * int option
val uripath_encode : string -> string
val uripath_decode : string -> string
module Cookie :
sig
type t
val make :
?max_age:int ->
?domain:string ->
?path:string ->
?secure:bool ->
?comment:string ->
?comment_url:string ->
?ports:int list -> string -> string -> Nethttp.Cookie.t
val name : Nethttp.Cookie.t -> string
val value : Nethttp.Cookie.t -> string
val domain : Nethttp.Cookie.t -> string option
val path : Nethttp.Cookie.t -> string option
val ports : Nethttp.Cookie.t -> int list option
val max_age : Nethttp.Cookie.t -> int option
val secure : Nethttp.Cookie.t -> bool
val comment : Nethttp.Cookie.t -> string
val comment_url : Nethttp.Cookie.t -> string
val set_value : Nethttp.Cookie.t -> string -> unit
val set_max_age : Nethttp.Cookie.t -> int option -> unit
val set_domain : Nethttp.Cookie.t -> string option -> unit
val set_path : Nethttp.Cookie.t -> string option -> unit
val set_secure : Nethttp.Cookie.t -> bool -> unit
val set_comment : Nethttp.Cookie.t -> string -> unit
val set_comment_url : Nethttp.Cookie.t -> string -> unit
val set_ports : Nethttp.Cookie.t -> int list option -> unit
val of_netscape_cookie : Nethttp.netscape_cookie -> Nethttp.Cookie.t
val to_netscape_cookie : Nethttp.Cookie.t -> Nethttp.netscape_cookie
end
module Header :
sig
type param_value = [ `Q of string | `V of string ]
type auth_challenge =
string * (string * Nethttp.Header.param_value) list
type auth_credentials =
string * (string * Nethttp.Header.param_value) list
val parse_quoted_parameters : string -> (string * string) list
val print_param_value : Nethttp.Header.param_value -> string
val value_of_param : Nethttp.Header.param_value -> string
val get_accept :
#Nethttp.http_header_ro ->
(string * (string * string) list * (string * string) list) list
val best_media_type :
#Nethttp.http_header_ro ->
string list -> string * (string * string) list
val set_accept :
#Nethttp.http_header ->
(string * (string * string) list * (string * string) list) list ->
unit
val get_accept_charset :
#Nethttp.http_header_ro -> (string * (string * string) list) list
val best_charset : #Nethttp.http_header_ro -> string list -> string
val set_accept_charset :
#Nethttp.http_header ->
(string * (string * string) list) list -> unit
val get_accept_encoding :
#Nethttp.http_header_ro -> (string * (string * string) list) list
val best_encoding : #Nethttp.http_header_ro -> string list -> string
val set_accept_encoding :
#Nethttp.http_header ->
(string * (string * string) list) list -> unit
val get_accept_language :
#Nethttp.http_header_ro -> (string * (string * string) list) list
val set_accept_language :
#Nethttp.http_header ->
(string * (string * string) list) list -> unit
val get_accept_ranges : #Nethttp.http_header_ro -> string list
val set_accept_ranges : #Nethttp.http_header -> string list -> unit
val get_age : #Nethttp.http_header_ro -> float
val set_age : #Nethttp.http_header -> float -> unit
val get_allow : #Nethttp.http_header_ro -> string list
val set_allow : #Nethttp.http_header -> string list -> unit
val get_authentication_info :
#Nethttp.http_header_ro -> (string * Nethttp.Header.param_value) list
val set_authentication_info :
#Nethttp.http_header ->
(string * Nethttp.Header.param_value) list -> unit
val get_authorization :
#Nethttp.http_header_ro -> Nethttp.Header.auth_credentials
val set_authorization :
#Nethttp.http_header -> Nethttp.Header.auth_credentials -> unit
val get_cache_control :
#Nethttp.http_header_ro -> Nethttp.cache_control_token list
val set_cache_control :
#Nethttp.http_header -> Nethttp.cache_control_token list -> unit
val get_connection : #Nethttp.http_header_ro -> string list
val set_connection : #Nethttp.http_header -> string list -> unit
val get_content_encoding : #Nethttp.http_header_ro -> string list
val set_content_encoding : #Nethttp.http_header -> string list -> unit
val get_content_language : #Nethttp.http_header_ro -> string list
val set_content_language : #Nethttp.http_header -> string list -> unit
val get_content_length : #Nethttp.http_header_ro -> int64
val set_content_length : #Nethttp.http_header -> int64 -> unit
val get_content_location : #Nethttp.http_header_ro -> string
val set_content_location : #Nethttp.http_header -> string -> unit
val get_content_md5 : #Nethttp.http_header_ro -> string
val set_content_md5 : #Nethttp.http_header -> string -> unit
val get_content_range :
#Nethttp.http_header_ro ->
[ `Bytes of (int64 * int64) option * int64 option ]
val set_content_range :
#Nethttp.http_header ->
[ `Bytes of (int64 * int64) option * int64 option ] -> unit
val get_content_type :
#Nethttp.http_header_ro -> string * (string * string) list
val set_content_type :
#Nethttp.http_header -> string * (string * string) list -> unit
val get_date : #Nethttp.http_header_ro -> float
val set_date : #Nethttp.http_header -> float -> unit
val get_etag : #Nethttp.http_header_ro -> Nethttp.etag
val set_etag : #Nethttp.http_header -> Nethttp.etag -> unit
val get_expect :
#Nethttp.http_header_ro ->
(string * string option * (string * string) list) list
val set_expect :
#Nethttp.http_header ->
(string * string option * (string * string) list) list -> unit
val get_expires : #Nethttp.http_header_ro -> float
val set_expires : #Nethttp.http_header -> float -> unit
val get_from : #Nethttp.http_header_ro -> string
val set_from : #Nethttp.http_header -> string -> unit
val get_host : #Nethttp.http_header_ro -> string * int option
val set_host : #Nethttp.http_header -> string * int option -> unit
val get_if_match : #Nethttp.http_header_ro -> Nethttp.etag list option
val set_if_match :
#Nethttp.http_header -> Nethttp.etag list option -> unit
val get_if_modified_since : #Nethttp.http_header_ro -> float
val set_if_modified_since : #Nethttp.http_header -> float -> unit
val get_if_none_match :
#Nethttp.http_header_ro -> Nethttp.etag list option
val set_if_none_match :
#Nethttp.http_header -> Nethttp.etag list option -> unit
val get_if_range :
#Nethttp.http_header_ro -> [ `Date of float | `Etag of Nethttp.etag ]
val set_if_range :
#Nethttp.http_header ->
[ `Date of float | `Etag of Nethttp.etag ] -> unit
val get_if_unmodified_since : #Nethttp.http_header_ro -> float
val set_if_unmodified_since : #Nethttp.http_header -> float -> unit
val get_last_modified : #Nethttp.http_header_ro -> float
val set_last_modified : #Nethttp.http_header -> float -> unit
val get_location : #Nethttp.http_header_ro -> string
val set_location : #Nethttp.http_header -> string -> unit
val get_max_forwards : #Nethttp.http_header_ro -> int
val set_max_forwards : #Nethttp.http_header -> int -> unit
val get_pragma :
#Nethttp.http_header_ro -> (string * string option) list
val set_pragma :
#Nethttp.http_header -> (string * string option) list -> unit
val get_proxy_authenticate :
#Nethttp.http_header_ro -> Nethttp.Header.auth_challenge list
val set_proxy_authenticate :
#Nethttp.http_header -> Nethttp.Header.auth_challenge list -> unit
val get_proxy_authentication_info :
#Nethttp.http_header_ro -> (string * Nethttp.Header.param_value) list
val set_proxy_authentication_info :
#Nethttp.http_header ->
(string * Nethttp.Header.param_value) list -> unit
val get_proxy_authorization :
#Nethttp.http_header_ro -> Nethttp.Header.auth_credentials
val set_proxy_authorization :
#Nethttp.http_header -> Nethttp.Header.auth_credentials -> unit
val get_range :
#Nethttp.http_header_ro ->
[ `Bytes of (int64 option * int64 option) list ]
val set_range :
#Nethttp.http_header ->
[ `Bytes of (int64 option * int64 option) list ] -> unit
val get_referer : #Nethttp.http_header_ro -> string
val get_referrer : #Nethttp.http_header_ro -> string
val set_referer : #Nethttp.http_header -> string -> unit
val set_referrer : #Nethttp.http_header -> string -> unit
val get_retry_after :
#Nethttp.http_header_ro -> [ `Date of float | `Seconds of int ]
val set_retry_after :
#Nethttp.http_header -> [ `Date of float | `Seconds of int ] -> unit
val get_server : #Nethttp.http_header_ro -> string
val set_server : #Nethttp.http_header -> string -> unit
val get_te :
#Nethttp.http_header_ro ->
(string * (string * string) list * (string * string) list) list
val set_te :
#Nethttp.http_header ->
(string * (string * string) list * (string * string) list) list ->
unit
val get_trailer : #Nethttp.http_header_ro -> string list
val set_trailer : #Nethttp.http_header -> string list -> unit
val get_transfer_encoding :
#Nethttp.http_header_ro -> (string * (string * string) list) list
val set_transfer_encoding :
#Nethttp.http_header ->
(string * (string * string) list) list -> unit
val get_upgrade : #Nethttp.http_header_ro -> string list
val set_upgrade : #Nethttp.http_header -> string list -> unit
val get_user_agent : #Nethttp.http_header_ro -> string
val set_user_agent : #Nethttp.http_header -> string -> unit
val get_vary :
#Nethttp.http_header_ro -> [ `Fields of string list | `Star ]
val set_vary :
#Nethttp.http_header -> [ `Fields of string list | `Star ] -> unit
val get_www_authenticate :
#Nethttp.http_header_ro -> Nethttp.Header.auth_challenge list
val set_www_authenticate :
#Nethttp.http_header -> Nethttp.Header.auth_challenge list -> unit
val get_cookie : #Nethttp.http_header_ro -> (string * string) list
val get_cookie_ct : #Nethttp.http_header_ro -> Nethttp.Cookie.t list
val set_cookie : #Nethttp.http_header -> (string * string) list -> unit
val get_set_cookie :
#Nethttp.http_header_ro -> Nethttp.netscape_cookie list
val set_set_cookie :
#Nethttp.http_header -> Nethttp.netscape_cookie list -> unit
val set_set_cookie_ct :
#Nethttp.http_header -> Nethttp.Cookie.t list -> unit
end
type transport_layer_id = int
val new_trans_id : unit -> Nethttp.transport_layer_id
val http_trans_id : Nethttp.transport_layer_id
val https_trans_id : Nethttp.transport_layer_id
val spnego_trans_id : Nethttp.transport_layer_id
val proxy_only_trans_id : Nethttp.transport_layer_id
type match_result =
[ `Accept of string * string option
| `Accept_reroute of
string * string option * Nethttp.transport_layer_id
| `Reject
| `Reroute of string * Nethttp.transport_layer_id ]
module type HTTP_CLIENT_MECHANISM =
sig
val mechanism_name : string
val available : unit -> bool
val restart_supported : bool
type credentials
val init_credentials :
(string * string * (string * string) list) list ->
Nethttp.HTTP_CLIENT_MECHANISM.credentials
val client_match :
params:(string * string * bool) list ->
Nethttp.Header.auth_challenge -> Nethttp.match_result
type client_session
val client_state :
Nethttp.HTTP_CLIENT_MECHANISM.client_session ->
Netsys_sasl_types.client_state
val create_client_session :
user:string ->
creds:Nethttp.HTTP_CLIENT_MECHANISM.credentials ->
params:(string * string * bool) list ->
unit -> Nethttp.HTTP_CLIENT_MECHANISM.client_session
val client_configure_channel_binding :
Nethttp.HTTP_CLIENT_MECHANISM.client_session ->
Netsys_sasl_types.cb -> Nethttp.HTTP_CLIENT_MECHANISM.client_session
val client_restart :
params:(string * string * bool) list ->
Nethttp.HTTP_CLIENT_MECHANISM.client_session ->
Nethttp.HTTP_CLIENT_MECHANISM.client_session
val client_process_challenge :
Nethttp.HTTP_CLIENT_MECHANISM.client_session ->
string ->
string ->
#Nethttp.http_header_ro ->
Nethttp.Header.auth_challenge ->
Nethttp.HTTP_CLIENT_MECHANISM.client_session
val client_emit_response :
Nethttp.HTTP_CLIENT_MECHANISM.client_session ->
string ->
string ->
#Nethttp.http_header_ro ->
Nethttp.HTTP_CLIENT_MECHANISM.client_session *
Nethttp.Header.auth_credentials * (string * string) list
val client_channel_binding :
Nethttp.HTTP_CLIENT_MECHANISM.client_session -> Netsys_sasl_types.cb
val client_user_name :
Nethttp.HTTP_CLIENT_MECHANISM.client_session -> string
val client_stash_session :
Nethttp.HTTP_CLIENT_MECHANISM.client_session -> string
val client_resume_session :
string -> Nethttp.HTTP_CLIENT_MECHANISM.client_session
val client_session_id :
Nethttp.HTTP_CLIENT_MECHANISM.client_session -> string option
val client_domain :
Nethttp.HTTP_CLIENT_MECHANISM.client_session -> string list
val client_prop :
Nethttp.HTTP_CLIENT_MECHANISM.client_session -> string -> string
val client_gssapi_props :
Nethttp.HTTP_CLIENT_MECHANISM.client_session ->
Netsys_gssapi.client_props
end
val rev_split : (char -> bool) -> string -> string list
val qstring_of_value : string -> string
end`