Skip to content

https client #19

@ilmanzo

Description

@ilmanzo

sample program, client requesting an https resource :

import hunt.http;
import std.stdio;

void main()
{
    auto client = new HttpClient();
    auto request = new RequestBuilder().url("https://www.google.com").build();
    auto response = client.newCall(request).execute();
    if (response !is null)
    {
        writeln(response.getBody().asString());
    }
}

gives error

2020-May-31 09:36:05.8637941 | 7341 | warning | RealCall.execute | No any response in 15 secs | ../../../.dub/packages/hunt-http-0.6.0/hunt-http/source/hunt/http/client/RealCall.d:199
hunt.Exceptions.TimeoutException@../../../.dub/packages/hunt-http-0.6.0/hunt-http/source/hunt/http/client/RealCall.d(205)
----------------
../../../.dub/packages/hunt-http-0.6.0/hunt-http/source/hunt/http/client/RealCall.d:205 hunt.http.client.HttpClientResponse.HttpClientResponse hunt.http.client.RealCall.RealCall.execute() [0x55b790b27769]
source/app.d:9 _Dmain [0x55b790b19d3a]
Program exited with code 1

$ cat dub.selections.json
{
        "fileVersion": 1,
        "versions": {
                "hunt": "1.6.1",
                "hunt-extra": "1.0.0",
                "hunt-http": "0.6.0",
                "hunt-net": "0.5.0",
                "hunt-openssl": "1.0.1"
        }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions