Documentation
¶
Index ¶
- Variables
- func BaseURLHostMatches(baseURL, domain string) (bool, error)
- func BaseURLHostname(baseURL string) (string, error)
- func BaseURLOrigin(baseURL string) (string, string, int, error)
- func BaseURLPath(baseURL string) (string, error)
- func EnvironProxies(environ []string) map[string]string
- func EnvironUrlopenProxy(environ []string, req *http.Request) (*url.URL, error)
- func FormatURLHost(host string) string
- func Getproxies() map[string]string
- func Join(base, ref string) (string, error)
- func ParseQS(qs string, keepBlankValues bool) map[string][]string
- func ParseQSL(qs string, keepBlankValues bool) [][2]string
- func ProxyBypassEnvironment(host string, proxies map[string]string) bool
- func Quote(s, safe string) string
- func QuotePlus(s, safe string) string
- func SystemProxies() map[string]string
- func URL2Pathname(url string, requireScheme, resolveHost bool) (string, error)
- func URLEncode(pairs [][2]string) string
- func Unparse(u URL) string
- func Unquote(s string) string
- func UnquoteLatin1(s string) string
- func Unsplit(u URL) string
- func UrlopenProxy(req *http.Request) (*url.URL, error)
- type URL
- type URLError
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidIPv6 = errors.New("Invalid IPv6 URL")
ErrInvalidIPv6 is the ValueError urlsplit raises for unbalanced or malformed brackets
var ErrPortOutOfRange = errors.New("Port out of range 0-65535")
ErrPortOutOfRange is the ValueError SplitResult.port raises past 65535
var UsesParams = map[string]bool{"": true, "ftp": true, "hdl": true, "prospero": true, "http": true, "imap": true, "https": true, "shttp": true, "rtsp": true, "rtsps": true, "rtspu": true, "sip": true, "sips": true, "mms": true, "sftp": true, "tel": true}
var UsesRelative = map[string]bool{"": true, "ftp": true, "http": true, "gopher": true, "nntp": true, "imap": true, "wais": true, "file": true, "https": true, "shttp": true, "mms": true, "prospero": true, "rtsp": true, "rtsps": true, "rtspu": true, "sftp": true, "svn": true, "svn+ssh": true, "ws": true, "wss": true}
Functions ¶
func BaseURLHostMatches ¶
Reports whether the base URL hostname is the domain or one of its subdomains
func BaseURLHostname ¶
Lowercased hostname of a base URL that may lack a scheme, the urlparse ValueError on a bad netloc
func BaseURLOrigin ¶
Scheme, lowercased hostname and effective port of a base URL, empty with port 0 on no host or a bad port
func BaseURLPath ¶
Lowercased path of a base URL without trailing slashes, empty for a bare host, the urlparse ValueError on a bad netloc
func EnvironProxies ¶
Scheme to proxy map read from the environment the way urllib getproxies_environment reads it
func EnvironUrlopenProxy ¶
Urlopen proxy choice over an explicit environment in place of the process one
func FormatURLHost ¶
Host in HTTP URL authority form, bracketing IPv6 literals and escaping a zone percent
func Getproxies ¶
Environment proxies, or the operating system ones when the environment sets none, as urllib getproxies reads them
func ParseQSL ¶
Name value pairs of a query string as urllib.parse.parse_qsl splits and unquotes them, non strict
func ProxyBypassEnvironment ¶
Reports whether no_proxy exempts the host the way urllib proxy_bypass_environment decides
func Quote ¶
Percent encodes UTF-8 bytes like urllib.parse.quote, keeping letters, digits, _.-~ and the safe set
func SystemProxies ¶
No operating system proxy source outside macOS and Windows
func URL2Pathname ¶
Local path of a file URL like urllib.request.url2pathname, a WTF-8 str decoded with the fs error handler
func URLEncode ¶
Query string of ordered string pairs like urllib.parse.urlencode with its quote_plus default
func Unquote ¶
Percent decodes like urllib.parse.unquote, ASCII runs as UTF-8 with replacement and other text kept
func UnquoteLatin1 ¶
Percent decodes like urllib.parse.unquote with encoding latin-1, each decoded byte becoming the same code point
Types ¶
type URL ¶
type URL struct {
Scheme, Netloc, Path, Params, Query, Fragment string
}
URL holds the parts urllib.parse splits a URL into, params apart from the path
type URLError ¶
type URLError struct{ Reason string }
URLError is urllib.error.URLError, its reason wrapped in the urlopen error brackets
func (*URLError) PyTypeName ¶
Python exception class name the error stands for