urllibparse

Undocumented in source.

Members

Aliases

QuoteFunction
alias QuoteFunction = string function(string input, const(char)[] safe, string encoding, EncodingErrorHandling errors)

For customising quote behaviour in some functions

Classes

ValueException
class ValueException

D alternative to Python's ValueError

Enums

EncodingErrorHandling
enum EncodingErrorHandling

For specifying invalid sequence handling when encoding/decoding

Functions

decodeBytes
string decodeBytes(immutable(ubyte)[] b, string encoding, EncodingErrorHandling errors)

For compatibility with Python's bytes.decode

encodeString
immutable(ubyte)[] encodeString(string s, string encoding, EncodingErrorHandling errors)

For compatibility with Python's str.encode

parseQS
string[][string] parseQS(string qs, Flag!"keepBlankValues" keep_blank_values, Flag!"strictParsing" strict_parsing, string encoding, EncodingErrorHandling errors, int max_num_fields)

Parse a query given as a string argument.

parseQSL
QueryArg[] parseQSL(string qs, Flag!"keepBlankValues" keep_blank_values, Flag!"strictParsing" strict_parsing, string encoding, EncodingErrorHandling errors, int max_num_fields)

Parse a query given as a string argument.

quote
string quote(string input, const(char)[] safe, string encoding, EncodingErrorHandling errors)

quote('abc def') -> 'abc%20def'

quoteFromBytes
string quoteFromBytes(immutable(ubyte)[] input, const(char)[] safe)
Undocumented in source. Be warned that the author may not have intended to support it.
quotePlus
string quotePlus(string input, const(char)[] safe, string encoding, EncodingErrorHandling errors)

Like quote(), but also replace ' ' with '+', as required for quoting HTML form values. Plus signs in the original string are escaped unless they are included in safe. It also does not have safe default to '/'.

unquote
string unquote(string input, string encoding, EncodingErrorHandling errors)

Replace %xx escapes by their single-character equivalent. The optional encoding and errors parameters specify how to decode percent-encoded sequences into Unicode characters, as accepted by the bytes.decode() method.

unquotePlus
string unquotePlus(string input, string encoding, EncodingErrorHandling errors)

Like unquote(), but also replace plus signs by spaces, as required for unquoting HTML form values.

unquoteToBytes
immutable(ubyte)[] unquoteToBytes(string input)
unwrap
string unwrap(string url)
urlDefrag
URLDefragResult urlDefrag(string url)

Removes any existing fragment from URL.

urlEncode
string urlEncode(const(string[string]) query, const(char)[] safe, string encoding, EncodingErrorHandling errors, QuoteFunction quote_via)
string urlEncode(R query, const(char)[] safe, string encoding, EncodingErrorHandling errors, QuoteFunction quote_via)

Encode a dict or sequence of two-element tuples into a URL query string.

urlJoin
string urlJoin(string base, string url, Flag!"allowFragments" allow_fragments)

Join a base URL and a possibly relative URL to form an absolute interpretation of the latter.

urlParse
URLParseResult urlParse(string url, string scheme, Flag!"allowFragments" allow_fragments)

Parse a URL into 6 components: (scheme)://(netloc)/(path);(params)?(query)#(fragment)

urlSplit
URLSplitResult urlSplit(string url, string scheme, Flag!"allowFragments" allow_fragments)

Parse a URL into 5 components: (scheme)://(netloc)/(path)?(query)#(fragment)

urlUnparse
string urlUnparse(const(URLParseResult) components)

Put a parsed URL back together again. This may result in a slightly different, but equivalent URL, if the URL that was parsed originally had redundant delimiters, e.g. a ? with an empty query (the draft states that these are equivalent).

urlUnsplit
string urlUnsplit(const(URLSplitResult) components)

Combine the elements of a tuple as returned by urlSplit() into a complete URL as a string. The data argument can be any five-item iterable. This may result in a slightly different, but equivalent URL, if the URL that was parsed originally had unnecessary delimiters (for example, a ? with an empty query; the RFC states that these are equivalent).

Structs

QueryArg
struct QueryArg

For URL query string name=value pairs

URLDefragResult
struct URLDefragResult

Result type for urlDefrag()

URLParseResult
struct URLParseResult

Result type for urlParse()

URLSplitResult
struct URLSplitResult

Result type for urlSplit()

Variables

non_hierarchical
auto non_hierarchical;
Undocumented in source.
scheme_chars
auto scheme_chars;
Undocumented in source.
uses_fragment
auto uses_fragment;
Undocumented in source.
uses_netloc
auto uses_netloc;
Undocumented in source.
uses_params
auto uses_params;
Undocumented in source.
uses_query
auto uses_query;
Undocumented in source.
uses_relative
auto uses_relative;
Undocumented in source.

Meta