Project

General

Profile

problem with http::client

Added by egor bayanov over 5 years ago

HEllo.

Faced a problem and did not find anything like this here.

I'm trying to send a GET request:

client = Wt::WApplication::instance()root()>addChild(std::make_uniqueWt::Http::Client());

...

{

client~~done().connect([](Wt::AsioWrapper::error_code err, Wt::Http::Message const& response)~~> void {

if (!err && response.status() == 200) {

cout << "Response Body" << response.body() << endl;

}

});

bool result = client->get(url);

...

}

And the request does go away, but there is no answer. The err returns a asio:misc:2, and the response.status=--1.

I absolutely can't understand what's wrong here.

Thanks.


Replies (1)

RE: problem with http::client - Added by egor bayanov over 5 years ago

client = Wt::WApplication::instance()root()>addChild(std::make_uniqueWt::Http::Client());

... {

client~~done().connect([](Wt::AsioWrapper::error_code err, Wt::Http::Message const& response)~~> void {

if (!err && response.status() == 200) {

cout << "Response Body" << response.body() << endl;

}

});

bool result = client->get(url);

...

}

    (1-1/1)