ae.net.ietf.url

ae.net.ietf.url

Members

Aliases

UrlParameters
alias UrlParameters = MultiAA!(string, string)

Type to hold decoded URL query string parameters.

encodeUrlParameter
alias encodeUrlParameter = encodeUrlPart!(c => isAlphaNum(c) || c == '-' || c == '_')

Encode a URL parameter, escaping all non-alpha-numeric characters except '-' and '_'.

Functions

applyRelativeURL
string applyRelativeURL(string base, string rel)

Calculate the full URL given a base and a target relative URL.

decodeUrlParameter
string decodeUrlParameter(string encoded)

Decodes a single URL parameter.

decodeUrlParameters
UrlParameters decodeUrlParameters(string qs)

Decodes URL parameters from a query string. (Do not include the leading '?').

encodeUrlParameters
string encodeUrlParameters(UrlParameters dic)

Encodes URL parameters into a query string (without a leading '?')).

encodeUrlParameters
string encodeUrlParameters(string[string] dic)
Undocumented in source. Be warned that the author may not have intended to support it.
encodeUrlPart
string encodeUrlPart(string s)

Encode an URL part using a custom predicate.

fileNameFromURL
string fileNameFromURL(string url)

Return a likely base file name given a URL, stripping the host/port/path and query string.

Templates

UrlEncoder
template UrlEncoder(alias isCharAllowed, char escape = '%')

Encode an URL part using a custom predicate to decide which characters to encode.

Meta

License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Authors

Vladimir Panteleev <ae@cy.md>