url

A URL handling library.

URLs are Unique Resource Locators. They consist of a scheme and a host, with some optional elements like port, path, username, and password.

This module aims to make it simple to muck about with them.

Example usage:

auto url = "ssh://me:password@192.168.0.8/".parseURL;
auto files = system("ssh", url.toString, "ls").splitLines;
foreach (file; files) {
		system("scp", url ~ file, ".");
}

Members

Classes

URLException
class URLException

An exception thrown when something bad happens with URLs.

Functions

parseURL
URL parseURL(string value)

Parse the input string as a URL.

percentDecode
string percentDecode(string encoded)

Percent-decode a string.

percentDecodeRaw
ubyte[] percentDecodeRaw(string encoded)

Percent-decode a string into a ubyte array.

percentEncode
string percentEncode(string raw)

Percent-encode a string.

punyDecode
string punyDecode(string input)

Decode the input string using the Punycode algorithm.

punyEncode
string punyEncode(string input)

Encode the input string using the Punycode algorithm.

tryParseURL
bool tryParseURL(string value, URL url)

Parse a URL from a string.

Structs

URL
struct URL

A Unique Resource Locator.

Variables

schemeToDefaultPort
ushort[string] schemeToDefaultPort;

* A mapping from schemes to their default ports. * This is not exhaustive. Not all schemes use ports. Not all schemes uniquely identify a port to * use even if they use ports. Entries here should be treated as best guesses.

Meta

License

The MIT license.