Index  |  Related pages  |  Classes  |  Functions  |  Entities  |  Function Sets  |  Groups

ClassURI

class URI( [path] )

Interface to RFC3986 Universal Resource Indicator. more...


Member list

Properties
fragment Fragment string in the uri (following path and query after a '#').
host Host specificator.
path Path specificator.
port Optional port specificator (following the host after a ':').
query Query string in the URI.
scheme URI scheme.
uri Complete URI.
userInfo User, password or account specification preceding '@' host.
Constructor
init Constructor for the URI class.
Methods
decode Decode a string to from URL encoding (static).
encode Encode a string to URL encoding (static).
getFields Returns fields contained in the query element into a dictionary.
setFields Sets query fields for this uri.

Detailed description

This class offers an object oriented interface to access URI elements.

Setting the properties in this class immediately reflects on the related fields; in example setting the value of the uri property causes a complete re-parse of the item; setting a field as the query string will cause the uri to change.

Each update is subject to RFC3986 compliance checks, and will raise a ParseError if conformance of the URI object is broken.


Class properties

fragment
Fragment string in the uri (following path and query after a '#').

host
Host specificator.

path
Path specificator.

port
Optional port specificator (following the host after a ':').

query
Query string in the URI.

scheme
URI scheme.

uri
Complete URI.

userInfo
User, password or account specification preceding '@' host.


Class methods

init()

Constructor for the URI class.

URI.init( [path] )
path

The URI that will be used as initial data.

Raises:
ParamError

in case the inital URI is malformed.

Builds the URI object, optionally using the given parameter as a complete URI constructor.

decode()

Decode a string to from URL encoding (static).

URI.decode( enc_string )
enc_string

The URI/URL encoded string.

Returns:

The decoded string.

Raises:
ParamError

if the string is not a valid URI/URL encoded string.

encode()

Encode a string to URL encoding (static).

URI.encode( string )
string

The string to be encoded.

Returns:

the URL/URI encoded string.

getFields()

Returns fields contained in the query element into a dictionary.

URI.getFields( )
Returns:

The fields as a dictionary of nil if the query part contains no element.

Raises:
ParamError

if the string is not a valid URI/URL encoded string.

setFields()

Sets query fields for this uri.

URI.setFields( fields )
fields

A dictionary of fields or nil to clear the query.

Raises:
ParamError

if the input dictionary contains non-string values.


Index  |  Related pages  |  Classes  |  Functions  |  Entities  |  Function Sets  |  Groups
Made with Faldoc 1.0.0