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
¶ Hostname part from
UrlParser.parsed
.- Return type
-
property
port
¶ Port part from
UrlParser.parsed
.- Return type
-
property
scheme
¶ Scheme part from
UrlParser.parsed
.- Return type
-
property
url
¶ Get scheme, hostname, and port from
UrlParser.parsed
.- Return type
-
property
url_full
¶ Get full URL from
UrlParser.parsed
.- Return type
-
property
parsed_str
¶ Get a str value of
UrlParser.parsed
.- Return type
-
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
-