sig
type representation =
[ `MIME of Netmime.mime_message | `Simple of Netmime.mime_body ]
type store = [ `File of string | `Memory ]
exception Oversized
exception Too_many_arguments
class type cgi_argument =
object
method charset : string
method content_type :
unit -> string * (string * Netmime_string.s_param) list
method filename : string option
method finalize : unit -> unit
method name : string
method open_value_rd : unit -> Netchannels.in_obj_channel
method representation : Netcgi_common.representation
method store : Netcgi_common.store
method value : string
end
class type rw_cgi_argument =
object
method charset : string
method content_type :
unit -> string * (string * Netmime_string.s_param) list
method filename : string option
method finalize : unit -> unit
method name : string
method open_value_rd : unit -> Netchannels.in_obj_channel
method open_value_wr : unit -> Netchannels.out_obj_channel
method representation : representation
method ro : bool
method set_value : string -> unit
method store : store
method value : string
end
class simple_arg : ?ro:bool -> string -> string -> rw_cgi_argument
class mime_arg :
?work_around_backslash_bug:bool ->
?name:string -> Netmime.mime_message -> rw_cgi_argument
module Cookie :
sig
type t = Nethttp.Cookie.t
val make :
?max_age:int ->
?domain:string ->
?path:string ->
?secure:bool ->
?comment:string ->
?comment_url:string ->
?ports:int list -> string -> string -> Netcgi_common.Cookie.t
val name : Netcgi_common.Cookie.t -> string
val value : Netcgi_common.Cookie.t -> string
val max_age : Netcgi_common.Cookie.t -> int option
val domain : Netcgi_common.Cookie.t -> string option
val path : Netcgi_common.Cookie.t -> string option
val secure : Netcgi_common.Cookie.t -> bool
val comment : Netcgi_common.Cookie.t -> string
val comment_url : Netcgi_common.Cookie.t -> string
val ports : Netcgi_common.Cookie.t -> int list option
val set_value : Netcgi_common.Cookie.t -> string -> unit
val set_max_age : Netcgi_common.Cookie.t -> int option -> unit
val set_domain : Netcgi_common.Cookie.t -> string option -> unit
val set_path : Netcgi_common.Cookie.t -> string option -> unit
val set_secure : Netcgi_common.Cookie.t -> bool -> unit
val set_comment : Netcgi_common.Cookie.t -> string -> unit
val set_comment_url : Netcgi_common.Cookie.t -> string -> unit
val set_ports : Netcgi_common.Cookie.t -> int list option -> unit
val set : #Netmime.mime_header -> Netcgi_common.Cookie.t list -> unit
val get : #Netmime.mime_header -> Netcgi_common.Cookie.t list
val of_record : Nethttp.cookie -> Netcgi_common.Cookie.t
val to_record : Netcgi_common.Cookie.t -> Nethttp.cookie
end
type config = {
tmp_directory : string;
tmp_prefix : string;
permitted_http_methods : [ `DELETE | `GET | `HEAD | `POST | `PUT ] list;
permitted_input_content_types : string list;
input_content_length_limit : int;
max_arguments : int;
workarounds :
[ `Backslash_bug
| `MSIE_Content_type_bug
| `Work_around_MSIE_Content_type_bug
| `Work_around_backslash_bug ] list;
default_exn_handler : bool;
}
type output_type =
[ `Direct of string
| `Transactional of
Netcgi_common.config ->
Netchannels.out_obj_channel -> Netchannels.trans_out_obj_channel ]
val fix_MSIE_Content_type_bug : string -> string
val is_MSIE : string -> bool
class cgi_environment :
config:Netcgi_common.config ->
properties:(string * string) list ->
input_header:(string * string) list ->
Netchannels.out_obj_channel ->
object
val mutable header_not_sent : bool
method cgi_auth_type : string
method cgi_gateway_interface : string
method cgi_https : bool
method cgi_path_info : string
method cgi_path_translated : string
method cgi_properties : (string * string) list
method cgi_property : ?default:string -> string -> string
method cgi_query_string : string
method cgi_remote_addr : string
method cgi_remote_host : string
method cgi_remote_ident : string
method cgi_remote_user : string
method cgi_request_method : string
method cgi_script_name : string
method cgi_server_name : string
method cgi_server_port : int option
method cgi_server_protocol : string
method cgi_server_software : string
method config : Netcgi_common.config
method cookie : string -> Netcgi_common.Cookie.t
method cookies : Netcgi_common.Cookie.t list
method input_content_length : int
method input_content_type :
unit -> string * (string * Netmime_string.s_param) list
method input_content_type_string : string
method input_header : Netmime.mime_header
method input_header_field : ?default:string -> string -> string
method input_header_fields : (string * string) list
method log_error : string -> unit
method multiple_input_header_field : string -> string list
method multiple_output_header_field : string -> string list
method out_channel : Netchannels.out_obj_channel
method output_ch : Netchannels.out_obj_channel
method output_header : Netmime.mime_header
method output_header_field : ?default:string -> string -> string
method output_header_fields : (string * string) list
method protocol : Nethttp.protocol
method send_output_header : unit -> unit
method set_multiple_output_header_field : string -> string list -> unit
method set_output_header_field : string -> string -> unit
method set_output_header_fields : (string * string) list -> unit
method set_status : Nethttp.http_status -> unit
method user_agent : string
end
type other_url_spec = [ `Env | `None | `This of string ]
type query_string_spec =
[ `Args of Netcgi_common.rw_cgi_argument list
| `Env
| `None
| `This of Netcgi_common.cgi_argument list ]
type cache_control = [ `Max_age of int | `No_cache | `Unspecified ]
type request_method =
[ `DELETE | `GET | `HEAD | `POST | `PUT of Netcgi_common.cgi_argument ]
val string_of_request_method : Netcgi_common.request_method -> string
type arg_store_type =
[ `Automatic
| `Automatic_max of float
| `Discard
| `File
| `File_max of float
| `Memory
| `Memory_max of float ]
type arg_store =
Netcgi_common.cgi_environment ->
string -> Netmime.mime_header_ro -> Netcgi_common.arg_store_type
class cgi :
Netcgi_common.cgi_environment ->
Netcgi_common.output_type ->
Netcgi_common.request_method ->
Netcgi_common.cgi_argument list ->
object
method argument : string -> Netcgi_common.cgi_argument
method argument_exists : string -> bool
method argument_value : ?default:string -> string -> string
method arguments : Netcgi_common.cgi_argument list
method at_exit : (unit -> unit) -> unit
method environment : Netcgi_common.cgi_environment
method finalize : unit -> unit
method multiple_argument : string -> Netcgi_common.cgi_argument list
method out_channel : Netchannels.trans_out_obj_channel
method output : Netchannels.trans_out_obj_channel
method request_method : Netcgi_common.request_method
method set_header :
?status:Nethttp.http_status ->
?content_type:string ->
?content_length:int ->
?set_cookie:Nethttp.cookie list ->
?set_cookies:Netcgi_common.Cookie.t list ->
?cache:Netcgi_common.cache_control ->
?filename:string ->
?language:string ->
?script_type:string ->
?style_type:string ->
?fields:(string * string list) list -> unit -> unit
method set_redirection_header :
?set_cookies:Netcgi_common.Cookie.t list ->
?fields:(string * string list) list -> string -> unit
method url :
?protocol:Nethttp.protocol ->
?with_authority:Netcgi_common.other_url_spec ->
?with_script_name:Netcgi_common.other_url_spec ->
?with_path_info:Netcgi_common.other_url_spec ->
?with_query_string:Netcgi_common.query_string_spec -> unit -> string
end
val cgi_with_args :
(Netcgi_common.cgi_environment ->
Netcgi_common.output_type ->
Netcgi_common.request_method -> Netcgi_common.cgi_argument list -> 'a) ->
Netcgi_common.cgi_environment ->
Netcgi_common.output_type ->
Netchannels.in_obj_channel -> Netcgi_common.arg_store -> 'a
exception HTTP of Nethttp.http_status * string
val exn_handler_default :
Netcgi_common.cgi_environment ->
exn_handler:(Netcgi_common.cgi_environment -> (unit -> unit) -> unit) ->
finally:(unit -> unit) -> (unit -> exn option) -> unit
val error_page :
Netcgi_common.cgi_environment ->
Nethttp.http_status ->
(string * string list) list -> string -> string -> unit
val update_props_inheader :
string * string ->
(string * string) list * (string * string) list ->
(string * string) list * (string * string) list
val rm_htspace : (char -> bool) -> string -> int -> int -> string
val rev_split : (char -> bool) -> string -> string list
val is_prefix : string -> string -> bool
type http_method = [ `DELETE | `GET | `HEAD | `POST | `PUT ]
val string_of_http_method : Netcgi_common.http_method -> string
end