Creates a multipart/form-data object that is suitable for file uploads and other kinds of POST
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 keeps cookies, location, and some other state to reuse connections, when possible, like a web browser. You can use it as your entry point to make http requests.
A pseudo-cache to provide a mock server. Construct one of these, populate it with test responses, and pass it to HttpClient to do a network-free test.
Represents a HTTP request. You usually create these through a HttpClient.
WebSocket client, based on the browser api, though also with other api options.
auto request = get("http://arsdnet.net/"); request.send();
gets the text off a url. basic operation only.
Do not forget to call waitForCompletion() on the returned object!
It has no dependencies for basic operation, but does require OpenSSL libraries (or compatible) to be support HTTPS. This dynamically loaded on-demand (meaning it won't be loaded if you don't use it, but if you do use it, the openssl dynamic libraries must be found in the system search path).
You can compile with -version=without_openssl to entirely disable ssl 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.
import arsd.http2; void main() { auto client = new HttpClient(); auto request = client.request(Uri("http://dlang.org/")); auto response = request.waitForCompletion(); import std.stdio; writeln(response.contentText); writeln(response.code, " ", response.codeText); writeln(response.contentType); }
This is version 2 of my http/1.1 client implementation.