I am trying to make and HTTPS GET request in which i need to ignore the certificate warnings and also need to add the authentication token as a header in the request. i cannot find a way to do that correctly
Below is my code
// Creates an HTTP request and prints the length of the response stream.
pplx::task<void> HTTPStreamingAsync()
{
http_client client(L"https://os-swiftproxy01.servosity.com.lab:8080/v1/AUTH_ce6f184ab6ff49c0b6088ea66f50c4bb/Retesting/17/36/512/2");
http_request request(methods::GET);
request.headers().add(L"X-Auth-Token:", L"367f814f6c3d4744a877f2728a42b8b2");
//request.set_request_uri(L"Retesting/17/36/512/2");
// Make the request and asynchronously process the response.
return client.request(request).then([](http_response response)
{
}
int _tmain(int argc, _TCHAR* argv[])
{
HTTPStreamingAsync().wait();
return 0;
}
Any thoughts, why this code is not working?
Thanks
Below is my code
// Creates an HTTP request and prints the length of the response stream.
pplx::task<void> HTTPStreamingAsync()
{
http_client client(L"https://os-swiftproxy01.servosity.com.lab:8080/v1/AUTH_ce6f184ab6ff49c0b6088ea66f50c4bb/Retesting/17/36/512/2");
http_request request(methods::GET);
request.headers().add(L"X-Auth-Token:", L"367f814f6c3d4744a877f2728a42b8b2");
//request.set_request_uri(L"Retesting/17/36/512/2");
// Make the request and asynchronously process the response.
return client.request(request).then([](http_response response)
{
// Print the status code.
std::wostringstream ss;ss << L"Server returned returned status code " << response.status_code() << L'.' << std::endl;
std::wcout << ss.str();
});}
int _tmain(int argc, _TCHAR* argv[])
{
HTTPStreamingAsync().wait();
return 0;
}
Any thoughts, why this code is not working?
Thanks