We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
auto client = new hunt.http.client.Client(); auto res = client->request('GET', 'https://api.github.com/user', [ 'auth' => ['user', 'pass'] ]); writeln(res->getStatusCode()); // "200" writeln(res->getHeader('content-type')[0]); // 'application/json; charset=utf8' writeln(res->getBody()); // {"type":"User"...' // Send an asynchronous request. auto request = new hunt.http.client.Request('GET', 'http://httpbin.org'); auto promise = client->sendAsync(request)->then(function (response) { writeln('I completed! ' ~ response->getBody()); }); promise->wait();