arsd.http2

This is version 2 of my http/1.1 client implementation.

More...

Members

Classes

HttpApiClient
class HttpApiClient()

An experimental component for working with REST apis. Note that it is a zero-argument template, so to create one, use new HttpApiClient!()(args..) or you will get "HttpApiClient is used as a type" compile errors.

HttpClient
class HttpClient

Usage:

HttpRequest
class HttpRequest

When you send something, it creates a request and sends it asynchronously. The request object

Enums

HttpVerb
enum HttpVerb

Structs

BasicAuth
struct BasicAuth
HttpCookie
struct HttpCookie
HttpRequestParameters
struct HttpRequestParameters
HttpResponse
struct HttpResponse
LinkHeader
struct LinkHeader
Uri
struct Uri

Detailed Description

It has no dependencies for basic operation, but does require OpenSSL libraries (or compatible) to be support HTTPS. Compile with -version=with_openssl to enable such support.

http2.d, despite its name, does NOT implement HTTP/2.0, but this shouldn't matter for 99.9% of usage, since all servers will continue to support HTTP/1.1 for a very long time.

Examples

Demonstrates core functionality, using the HttpClient, HttpRequest (returned by client.navigateTo), and HttpResponse (returned by request.waitForCompletion).

1 import arsd.http2;
2 
3 void main() {
4 	auto client = new HttpClient();
5 	auto request = client.navigateTo(Uri("http://dlang.org/"));
6 	auto response = request.waitForCompletion();
7 
8 	string returnedHtml = response.contentText;
9 }
Suggestion Box / Bug Report