module AXOCom: sig
.. end
http_post url args
sends an HTTP POST request to the server with POST
arguments args
nicely encoded and return
(code,message)
where code
is the HTTP code and message
the content of
the answer.
val urlencode_string : string -> string
val urldecode_string : string -> string
val urlencode : (string * string) list -> string
val http_post : string -> (string * string) list -> int * string
http_post url args
sends an HTTP POST request to the server with POST
arguments args
nicely encoded and return
(code,message)
where code
is the HTTP code and message
the content of
the answer.
val http_get_post : string -> (string * string) list -> (string * string) list -> int * string
http_get_post url get_args post_args
makes and HTTP POST request with
get_args
encoded and appended to url
and post_args
as POST arguments.
It's result also is (code,message)
val http_get : string -> (string * string) list -> int * string
http_get url args
sends an HTTP GET request with args
encoded and
appended to url
. Result is identicall to those of http_post
and
http_get_post
.
val alert_on_code : ?on_1xx:(int * string -> unit) ->
?on_2xx:(int * string -> unit) ->
?on_3xx:(int * string -> unit) ->
?on_4xx:(int * string -> unit) ->
?on_5xx:(int * string -> unit) -> int * string -> unit
alert_on_code (code,message)
makes an alert pop up when code
is 400 or
500. Behaviour for each code type can be set via optional on_ixx
(where i is
1, 2, 3, 4 or 5) arguments.
val dynload_post : string ->
(string * string) list ->
?on_1xx:(int * string -> 'a) ->
?on_3xx:(int * string -> 'a) ->
?on_4xx:(int * string -> 'a) ->
?on_5xx:(int * string -> 'a) -> (string -> 'a) -> 'a
dynload_post url args parse
make a post request at url
with args
and
parse the result using parse
with the result of the http_post request
in case of a 200 return code. If not 200 the default (overidable
via on_ixx
(where i is 1, 3, 4 or 5) optional arguments) behaviour is to
fail.
val parse_xml : string -> JSOO.obj
parse_xml str
makes a DOM tree out of an xml tree using the browser engine
val print_xml : JSOO.obj -> string
print_xml obj
results in a string using the browser engine.
val pretty_print_xml : JSOO.obj -> string
pretty_print_xml obj
gives a xml string using the browser engine.
val check_for_error : JSOO.obj -> unit
Firefox doesn't fail nor raise an exception when a parsing error occurs. It
just returns a "<parsererror>" XML document. The following function just
checks for this result.
val write_fragment : JSOO.obj -> unit
Tamper url fragment (see http://ajaxpatterns.org/Unique_URLs ) for reasons
to use this 'hack'
val read_fragment : unit -> string
module Url: sig
.. end