Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Creating http_client
- http_client_config config;
- wchar_t* profileUserName = U("Admin");
- const wchar_t* profilePassword = U("");
- http::client::credentials cred(profileUserName,profilePassword);
- config.set_credentials(cred);
- http_client client(U("http://localhost:8091"),config);
- // create header
- http_request req(methods::GET);
- // Add base64 result to header
- req.headers().add(L"Authorization", L"Basic XYZtaW46Wr6yZW0xMAXY");
- //req.headers().add(L"Admin", L"");
- req.set_request_uri(L"/api/v1/Dimensions");
- pplx::task<http_response> responses = client.request(req);
- pplx::task<web::json::value> jvalue = responses.get().extract_json();
- wcout << jvalue.get().as_string();
Add Comment
Please, Sign In to add comment