std/url
On this page
Index
- type
EscapeErr- method
EscapeErr.display
- method
- type
Values- method
Values.get - method
Values.all - method
Values.has - method
Values.keys - method
Values.encode - method
Values.add - method
Values.set - method
Values.remove
- method
- fn
query_escape - fn
query_unescape - fn
path_escape - fn
path_unescape - fn
values - fn
parse_query
Types
EscapeErr
struct EscapeErr {
msg: Str
}A malformed escape or query; displays as Go’s text, for example
invalid URL escape "%zz".
EscapeErr.display
fn (e: EscapeErr) display() -> StrValues
struct Values {}Query keys with their values in order (url.Values): keys in the order they first appeared, each with every value given for it. A value, not a handle.
Values.get
fn (v: Values) get(key: Str) -> Str?The first value of key.
Values.all
fn (v: Values) all(key: Str) -> List[Str]Every value of key, [] when missing.
Values.has
fn (v: Values) has(key: Str) -> BoolValues.keys
fn (v: Values) keys() -> List[Str]The keys in the order they first appeared.
Values.encode
fn (v: Values) encode() -> Stra=1&b=2, sorted by key, each value escaped with query_escape
(Values.Encode).
Values.add
fn (var v: Values) add(key: Str, value: Str)Adds a value after the key’s others.
Values.set
fn (var v: Values) set(key: Str, value: Str)Replaces every value of key with value.
Values.remove
fn (var v: Values) remove(key: Str)Removes key and its values.
Functions
query_escape
fn query_escape(s: Str) -> Strs escaped for a query key or value: space as +, every byte but
letters, digits, -, ., _, and ~ as %XX (url.QueryEscape).
query_unescape
fn query_unescape(s: Str) -> Str ! EscapeErrThe inverse of query_escape: + is a space, %XX a byte.
path_escape
fn path_escape(s: Str) -> Strs escaped for one path segment: space as %20, / escaped
(url.PathEscape).
path_unescape
fn path_unescape(s: Str) -> Str ! EscapeErrThe inverse of path_escape: %XX a byte, + stays +.
values
fn values() -> Valuesparse_query
fn parse_query(s: Str) -> Values ! EscapeErra=1&b=2&a=3 into Values; a ; separator, a bad escape, or more than
10000 parameters is an error, as url.ParseQuery.