module Url:sig
..end
Dom_html.window
##location object.val urldecode : string -> string
urldecode s
swaps percent encoding characters for their usual
representation.val urlencode : ?with_plus:bool -> string -> string
urlencode ?with_plus s
replace characters for their percent encoding
representation. Note that the '/' (slash) character is escaped as well. If
with_plus
is true
(default) then '+'
's are escaped as "%2B"
. If not,
'+'
's are left as is.type
http_url = {
|
hu_host : |
(* |
The host part of the url.
| *) |
|
hu_port : |
(* |
The port for the connection if any.
| *) |
|
hu_path : |
(* |
The path splitted on
'/' characters. | *) |
|
hu_path_string : |
(* |
The original entire path.
| *) |
|
hu_arguments : |
(* |
Arguments as a field-value
association list.
| *) |
|
hu_fragment : |
(* |
The fragment part (after the
'#' character). | *) |
type
file_url = {
|
fu_path : |
|
fu_path_string : |
|
fu_arguments : |
|
fu_fragment : |
type
url =
| |
Http of |
(* |
Non secure HTTP urls
| *) |
| |
Https of |
(* |
Secure HTTPS urls
| *) |
| |
File of |
(* |
Local files
| *) |
val default_http_port : int
Http
communications (80).val default_https_port : int
Https
communications (443).val path_of_path_string : string -> string list
path_of_path_string s
splits s
on each "/"
character.val encode_arguments : (string * string) list -> string
encode_arguments a
expects a list of pair of values of the form
(name,value)
were name
is the name of an argument and value
it's
associated value.val decode_arguments : string -> (string * string) list
decode_arguments s
parses s
returning the sliced-diced
association list.val url_of_string : string -> url option
url_of_string s
parses s
and builds a value of type url
if s
is not
a valid url string, it returns None
.val string_of_url : url -> string
string_of_url u
returns a valid string representation of u
. Note that
* string_of_url ((fun Some u -> u) (url_of_string s))
is NOT necessarily
* equal to s
. However url_of_string (string_of_url u) = u
.module Current:sig
..end