Module

Web.URL

Package
purescript-web-url
Repository
mjepronk/purescript-web-url

#URL Source

data URL

Instances

#fromAbsolute Source

fromAbsolute :: String -> Maybe URL

Construct a URL from a string containing an absolute URL.

#fromRelative Source

fromRelative :: String -> String -> Maybe URL

Construct a URL from two strings containing a relative and absolute URL respectively.

#unsafeFromAbsolute Source

unsafeFromAbsolute :: String -> URL

If you know you have a valid (hardcoded) absolute URL, you could use this constructor.

#unsafeFromRelative Source

unsafeFromRelative :: String -> String -> URL

If you know you have a valid relative and absolute URL, you could use this constructor.

#toString Source

toString :: URL -> String

Returns a String containing the whole URL.

#href Source

href :: URL -> String

Returns a String containing the whole URL (synonym for toString).

#setHref Source

#protocol Source

protocol :: URL -> String

A String containing the protocol scheme of the URL, including the final ':'.

#setProtocol Source

#host Source

host :: URL -> String

A String containing the domain (that is the hostname) followed by (if a port was specified) a ':' and the port of the URL.

#setHost Source

#hostname Source

hostname :: URL -> String

A String containing the domain of the URL.

#setHostname Source

#username Source

username :: URL -> String

A String containing the username specified before the domain name.

#setUsername Source

#password Source

password :: URL -> String

A String containing the password specified before the domain name.

#setPassword Source

#port Source

port :: URL -> String

A String containing the port number of the URL.

#setPort Source

#pathname Source

pathname :: URL -> String

A String containing an initial '/' followed by the path of the URL.

#setPathname Source

#search Source

search :: URL -> String

A String indicating the URL's parameter string; if any parameters are provided, this string includes all of them, beginning with the leading '?' character.

#setSearch Source

#searchParams Source

searchParams :: URL -> URLSearchParams

A URLSearchParams object which can be used to access the individual query parameters found in search.

#hash Source

hash :: URL -> String

A String containing a '#' followed by the fragment identifier of the URL.

#setHash Source

#origin Source

origin :: URL -> String

Returns a String containing the origin of the URL, that is its scheme, its domain and its port.