Examples using... "net/url"
Recent
Values maps a string key to a list of values.
It is typically used for query parameters and form values.
Unlike in the http.Header map, the keys in a Values map
are case-sensitive.
String reassembles the URL into a valid URL string.
The general form of the result is one of:
ResolveReference resolves a URI reference to an absolute URI from
an absolute base URI u, per RFC 3986 Section 5.2. The URI reference
may be relative or absolute. ResolveReference always returns a new
URL instance, even if the returned URL is identical to either the
base or reference. If ref is an a...
RequestURI returns the encoded path?query or opaque?query
string that would be used in an HTTP request for u.
Query parses RawQuery and returns the corresponding values.
It silently discards malformed value pairs.
To check errors use ParseQuery.
Port returns the port part of u.Host, without the leading colon.
Parse parses a URL in the context of the receiver. The provided URL
may be relative or absolute. Parse returns nil, err on parse
failure, otherwise its return value is the same as ResolveReference.
IsAbs reports whether the URL is absolute.
Absolute means that it has a non-empty scheme.
Hostname returns u.Host, stripping any valid port number if present.
EscapedPath returns the escaped form of u.Path.
In general there are multiple possible escaped forms of any path.
EscapedPath returns u.RawPath when it is a valid escaping of u.Path.
Otherwise EscapedPath ignores u.RawPath and computes an escaped
form on its own.
The String and RequestURI methods us...
A URL represents a parsed URL (technically, a URI reference).
A URL represents a parsed URL (technically, a URI reference).
ParseQuery parses the URL-encoded query string and returns
a map listing the values specified for each key.
ParseQuery always returns a non-nil map containing all the
valid query parameters found; err describes the first decoding error
encountered, if any.
ReverseProxy is an HTTP Handler that takes an incoming request and
sends it to another server, proxying the response back to the
client.
New returns a new cookie jar. A nil *Options is equivalent to a zero
Options.
Value is the interface to the dynamic value stored in a flag.
(The default value is represented as a string.)
Parsing a URL which includes a scheme, authentication info, host, port, path, query params, and a query fragment.