uri
URI/URL Parsing and Encoding
Functions
| Function | Description |
|---|---|
uri_copy | Internal: copy bytes from src+off to dst, return len. |
uri_is_unreserved | Internal: is this byte unreserved (RFC 3986)? |
uri_hex_char | Internal: hex nibble to char. |
uri_hex_val | Internal: hex char to nibble. |
uri_parse | Parse a URI string into components. |
uri_scheme | |
uri_host | |
uri_port | |
uri_path | |
uri_query | |
uri_fragment | |
uri_encode | Percent-encode a string. Returns output length. |
uri_decode | Percent-decode a string. Returns output length. |
uri_query_get | Get a query parameter value by key. Returns length (0 if not found). query/ql… |
Details
uri_copy
fn uri_copy(src: &i8, off: i64, len: i64, dst: &i8) -> i64Internal: copy bytes from src+off to dst, return len.
uri_is_unreserved
fn uri_is_unreserved(ch: i64) -> i64Internal: is this byte unreserved (RFC 3986)?
uri_hex_char
fn uri_hex_char(n: i64) -> i64Internal: hex nibble to char.
uri_hex_val
fn uri_hex_val(ch: i64) -> i64Internal: hex char to nibble.
uri_parse
fn uri_parse(src: &i8, len: i64) -> &i64Parse a URI string into components.
uri_scheme
fn uri_scheme(u: &i64, dst: &i8) -> i64uri_host
fn uri_host(u: &i64, dst: &i8) -> i64uri_port
fn uri_port(u: &i64) -> i64uri_path
fn uri_path(u: &i64, dst: &i8) -> i64uri_query
fn uri_query(u: &i64, dst: &i8) -> i64uri_fragment
fn uri_fragment(u: &i64, dst: &i8) -> i64uri_encode
fn uri_encode(src: &i8, len: i64, dst: &i8) -> i64Percent-encode a string. Returns output length.
uri_decode
fn uri_decode(src: &i8, len: i64, dst: &i8) -> i64Percent-decode a string. Returns output length.
uri_query_get
fn uri_query_get(query: &i8, qlen: i64, key: &i8, klen: i64, dst: &i8) -> i64Get a query parameter value by key. Returns length (0 if not found). query/qlen is the raw query string, key/klen is the parameter name.