Expand description
Package url parses URLs and implements query escaping.
Structs§
Functions§
- Parse
- Parse parses rawurl into a URL structure.
- Parse
Query - 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.
- Path
Escape - PathEscape escapes the string so it can be safely placed inside a URL path segment, replacing special characters (including /) with %XX sequences as needed.
- Path
Unescape - PathUnescape does the inverse transformation of PathEscape, converting each 3-byte encoded substring of the form “%AB” into the hex-decoded byte 0xAB. It returns an error if any % is not followed by two hexadecimal digits.
- Query
Escape - QueryEscape escapes the string so it can be safely placed inside a URL query.
- Query
Unescape - QueryUnescape does the inverse transformation of QueryEscape, converting each 3-byte encoded substring of the form “%AB” into the hex-decoded byte 0xAB. It returns an error if any % is not followed by two hexadecimal digits.