Module Url.​Current

module Current : sig..end

This module can be used to handle the Url associated to the current document.


val host : string

The host part of the current url.

val port : int option

The port of the current url.

val protocol : string

The protocol of the current url.

val path_string : string

The path of the current url as one long string.

val path : string list

The path of the current url as a list of small string.

val arguments : (string * string) list

The arguments of the current url as an association list.

val get_fragment : unit -> string

Because the fragment of the Url for the current document can change dynamically, we use a functional value here.

val set_fragment : string -> unit

set_fragment s replaces the current fragment by s.

val get : unit -> Url.url option

get () returns a value of type Url.​url with fields reflecting the state of the current Url.

val set : Url.url -> unit

set u replaces the current Url for u. WARNING: Causes the document to change.

val as_string : string

as_string is the original string representation of the current Url. It is NOT necessarily equals to string_of_url (get ()) but url_of_string as_string = get () holds.