Skip to content

The new HttpClient

Brian Zou edited this page May 27, 2020 · 1 revision

Hunt HttpClient

Hunt HttpClient is a tool library for sending HTTP requests to Web service communications. provides a very good development experience for developers.

Simple code for get

import hunt.httpclient;

void main()
{
    string content = Http.get("http://api.example.com/user/1").content();

    writeln(content);
}

Simple code for post

import hunt.httpclient;

void main()
{
    auto response = Http.post("http://api.example.com/auto",
        ["username": "admin", "password": "hunt@@2020"]);

    string content = response.content();

    writeln(content);
}
Clone this wiki locally