urld 0.1.0
A URL parsing library
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
urld
URL handling for D
Motivation
D's standard library has nothing for working with URLs.
Vibe.d can work with URLs. However, Vibe is big. Also, we want to work easily with query strings, which vibe.d doesn't allow.
Status
urld does not currently support Unicode domain names.
There are some convenience accessors to add.
No backwards-incompatible changes are planned.
Installation
Add "urld": "~>0.1.0"
to your dub.json
.
Usage
Parse a URL:
auto url = "ircs://irc.freenode.com/#d".parseURL;
Construct one from scratch, laboriously:
URL url;
with (url) {
scheme = "soap.beep";
host = "beep.example.net";
port = 1772;
path = "/serverinfo/info";
query["token"] = "my-api-token";
}
curl.get(url.toString);
Autodetect ports:
assert(parseURL("http://example.org").port == 80);
assert(parseURL("http://example.org:5326").port == 5326);
URLs of maximum complexity:
auto url = parseURL("redis://admin:password@redisbox.local:2201/path?query=value#fragment");
assert(url.scheme == "redis");
assert(url.user == "admin");
assert(url.pass == "password");
// etc
URLs of minimum complexity:
assert(parseURL("example.org").toString == "http://example.org/");
Canonicalization:
assert(parseURL("http://example.org:80").toString == "http://example.org/");
- Registered by Christopher Wright
- 0.1.0 released 8 years ago
- dhasenan/urld
- MIT; see LICENSE.txt
- Copyright © 2015, dhasenan
- Authors:
- Dependencies:
- none
- Versions:
-
2.1.1 2018-Jul-22 2.1.0 2017-Jan-14 2.0.2 2017-Jan-12 2.0.1 2017-Jan-10 2.0.0 2017-Jan-08 - Download Stats:
-
-
34 downloads today
-
216 downloads this week
-
774 downloads this month
-
265221 downloads total
-
- Score:
- 3.9
- Short URL:
- urld.dub.pm