4.7.4.6. URLs¶
HTTP client.
- class axonius_api_client.parsers.url_parser.UrlParser(url, default_scheme='https')[source]¶
Bases:
object
Parse a URL and ensure it has the neccessary bits.
- INIT_PARSED¶
first pass of parsing URL
- parsed¶
second pass of parsing URL
- property hostname: str¶
Hostname part from
UrlParser.parsed
.
- property port: int¶
Port part from
UrlParser.parsed
.
- property scheme: str¶
Scheme part from
UrlParser.parsed
.
- property url: str¶
Get scheme, hostname, and port from
UrlParser.parsed
.
- property url_full: str¶
Get full URL from
UrlParser.parsed
.
- property parsed_str: str¶
Get a str value of
UrlParser.parsed
.
- make_netloc(host, port)[source]¶
Create netloc from host and port.
- Parameters
hosthost – hostname to use in netloc
portport – port to use in netloc
host (
str
) –port (
typing.Union
[str
,int
]) –
- Return type
- reparse(parsed, default_scheme='')[source]¶
Reparse a parsed URL into a parsed URL with values fixed.
- Parameters
parsed (
urllib.parse.ParseResult
) – parsed URL to reparsedefault_scheme (
str
) – default scheme to use if URL does not contain a scheme
- Returns
- unparse_base(parsed_result)[source]¶
Unparse a parsed URL into just the scheme, hostname, and port parts.
- Parameters
parsed (
urllib.parse.ParseResult
) – parsed URL to unparse- Return type
- unparse_all(parsed_result)[source]¶
Unparse a parsed URL with all the parts.
- Parameters
parsed (
urllib.parse.ParseResult
) – parsed URL to unparse- Return type