class documentation

class Url(namedtuple('Url', url_attrs)): (source)

View In Hierarchy

Data structure for representing an HTTP URL. Used as a return value for :func:`parse_url`. Both the scheme and host are normalized as they are both case-insensitive according to RFC 3986.

Method __new__ Undocumented
Method __str__ Undocumented
Class Variable __slots__ Undocumented
Property hostname For backwards-compatibility with urlparse. We're nice like that.
Property netloc Network location including host and port
Property request_uri Absolute path including the query string.
Property url Convert self into a url
def __new__(cls, scheme=None, auth=None, host=None, port=None, path=None, query=None, fragment=None): (source)

Undocumented

def __str__(self): (source)

Undocumented

__slots__: tuple = (source)

Undocumented

For backwards-compatibility with urlparse. We're nice like that.

Network location including host and port

@property
request_uri = (source)

Absolute path including the query string.

Convert self into a url This function should more or less round-trip with :func:`.parse_url`. The returned url may not be exactly the same as the url inputted to :func:`.parse_url`, but it should be equivalent by the RFC (e.g., urls with a blank port will have : removed). Example: :: >>> U = parse_url('http://google.com/mail/') >>> U.url 'http://google.com/mail/' >>> Url('http', 'username:password', 'host.com', 80, ... '/path', 'query', 'fragment').url 'http://username:password@host.com:80/path?query#fragment'