Go to the latest version of this document.

# ``twisted`.`web`.`client`.`URI``

class documentation

`class URI: (source)`

Constructor: `URI(scheme, netloc, host, port, ...)`

View In Hierarchy

A URI object.

See Also
https://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-21

Class Method | `fromBytes` | Parse the given URI into a `URI`.
Method | `__init__` | No summary
Method | `toBytes` | Assemble the individual parts of the URI into a fully formed URI.
Instance Variable | `fragment` | Undocumented
Instance Variable | `host` | Undocumented
Instance Variable | `netloc` | Undocumented
Instance Variable | `params` | Undocumented
Instance Variable | `path` | Undocumented
Instance Variable | `port` | Undocumented
Instance Variable | `query` | Undocumented
Instance Variable | `scheme` | Undocumented
Property | `originForm` | The absolute URI path including URI parameters, query string and fragment identifier.

@classmethod
def fromBytes(cls, uri, defaultPort=None): (source)

Parse the given URI into a `URI`.

Parameters
uri:`bytes` | URI to parse.
defaultPort:`int` or `None` | An alternate value to use as the port if the URI does not include one.

Returns
`URI` | Parsed URI instance.

def __init__(self, scheme, netloc, host, port, path, params, query, fragment): (source)

Parameters
scheme:`bytes` | URI scheme specifier.
netloc:`bytes` | Network location component.
host:`bytes` | Host name. For IPv6 address literals the brackets are stripped.
port:`int` | Port number.
path:`bytes` | Hierarchical path.
params:`bytes` | Parameters for last path segment.
query:`bytes` | Query string.
fragment:`bytes` | Fragment identifier.

def toBytes(self): (source)

Assemble the individual parts of the URI into a fully formed URI.

Returns
`bytes` | A fully formed URI.

fragment = (source)

Undocumented

host = (source)

Undocumented

netloc = (source)

Undocumented

params = (source)

Undocumented

path = (source)

Undocumented

port = (source)

Undocumented

query = (source)

Undocumented

scheme = (source)

Undocumented

@property
originForm: `bytes` = (source)

The absolute URI path including URI parameters, query string and fragment identifier.

See Also
https://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-21#section-5.3