class documentation

class UserAgent: (source)

View In Hierarchy

Represents a parsed user agent header value. The default implementation does no parsing, only the :attr:`string` attribute is set. A subclass may parse the string to set the common attributes or expose other information. Set :attr:`werkzeug.wrappers.Request.user_agent_class` to use a subclass. :param string: The header value to parse. .. versionadded:: 2.0 This replaces the previous ``useragents`` module, but does not provide a built-in parser.

Method __bool__ Undocumented
Method __init__ Undocumented
Method __repr__ Undocumented
Method __str__ Undocumented
Method to_header Convert to a header value.
Class Variable browser The browser name, if it could be parsed from the string.
Class Variable language The browser language, if it could be parsed from the string.
Class Variable platform The OS name, if it could be parsed from the string.
Class Variable version The browser version, if it could be parsed from the string.
Instance Variable string The original header value.
def __bool__(self) -> bool: (source)

Undocumented

def __init__(self, string: str): (source)

Undocumented

def __repr__(self) -> str: (source)

Undocumented

def __str__(self) -> str: (source)

Undocumented

def to_header(self) -> str: (source)

Convert to a header value.

The browser name, if it could be parsed from the string.

The browser language, if it could be parsed from the string.

The OS name, if it could be parsed from the string.

The browser version, if it could be parsed from the string.

The original header value.