URI

A #SoupURI represents a (parsed) URI.

Many applications will not need to use #SoupURI directly at all; on the client side, soup_message_new() takes a stringified URI, and on the server side, the path and query components are provided for you in the server callback.

Constructors

this
this(SoupURI* soupURI, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this(string uriString)

Parses an absolute URI.

this
this(URI base, string uriString)

Parses @uri_string relative to @base.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

copy
URI copy()

Copies @uri

copyHost
URI copyHost()

Makes a copy of @uri, considering only the protocol, host, and port

equal
bool equal(URI uri2)

Tests whether or not @uri1 and @uri2 are equal in all parts

free
void free()

Frees @uri.

getFragment
string getFragment()

Gets @uri's fragment.

getHost
string getHost()

Gets @uri's host.

getPassword
string getPassword()

Gets @uri's password.

getPath
string getPath()

Gets @uri's path.

getPort
uint getPort()

Gets @uri's port.

getQuery
string getQuery()

Gets @uri's query.

getScheme
string getScheme()

Gets @uri's scheme.

getStruct
void* getStruct()

the main Gtk struct as a void*

getURIStruct
SoupURI* getURIStruct(bool transferOwnership)

Get the main Gtk struct

getUser
string getUser()

Gets @uri's user.

hostEqual
bool hostEqual(URI v2)

Compares @v1 and @v2, considering only the scheme, host, and port.

hostHash
uint hostHash()

Hashes @key, considering only the scheme, host, and port.

setFragment
void setFragment(string fragment)

Sets @uri's fragment to @fragment.

setHost
void setHost(string host)

Sets @uri's host to @host.

setPassword
void setPassword(string password)

Sets @uri's password to @password.

setPath
void setPath(string path)

Sets @uri's path to @path.

setPort
void setPort(uint port)

Sets @uri's port to @port. If @port is 0, @uri will not have an explicitly-specified port.

setQuery
void setQuery(string query)

Sets @uri's query to @query.

setQueryFromForm
void setQueryFromForm(HashTable form)

Sets @uri's query to the result of encoding @form according to the HTML form rules. See soup_form_encode_hash() for more information.

setScheme
void setScheme(string scheme)

Sets @uri's scheme to @scheme. This will also set @uri's port to the default port for @scheme, if known.

setUser
void setUser(string user)

Sets @uri's user to @user.

toString
string toString(bool justPathAndQuery)

Returns a string representing @uri.

usesDefaultPort
bool usesDefaultPort()

Tests if @uri uses the default port for its scheme. (Eg, 80 for http.) (This only works for http, https and ftp; libsoup does not know the default ports of other protocols.)

Properties

fragment
string fragment [@property getter]
string fragment [@property setter]

a fragment identifier within @path, or %NULL

host
string host [@property getter]
string host [@property setter]

the hostname or IP address, or %NULL

password
string password [@property getter]
string password [@property setter]

a password, or %NULL

path
string path [@property getter]
string path [@property setter]

the path on @host

port
uint port [@property getter]
uint port [@property setter]

the port number on @host

query
string query [@property getter]
string query [@property setter]

a query for @path, or %NULL

scheme
string scheme [@property getter]
string scheme [@property setter]

the URI scheme (eg, "http")

user
string user [@property getter]
string user [@property setter]

a username, or %NULL

Static functions

decode
string decode(string part)

Fully %<!-- -->-decodes @part.

encode
string encode(string part, string escapeExtra)

This %<!-- -->-encodes the given URI part and returns the escaped version in allocated memory, which the caller must free when it is done.

getType
GType getType()
normalize
string normalize(string part, string unescapeExtra)

%<!-- -->-decodes any "unreserved" characters (or characters in @unescape_extra) in @part, and %<!-- -->-encodes any non-ASCII characters, spaces, and non-printing characters in @part.

Variables

ownedRef
bool ownedRef;
Undocumented in source.
soupURI
SoupURI* soupURI;

the main Gtk struct

Meta