Guest User

Untitled

a guest
Oct 27th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. // Creating http_client
  2. http_client_config config;
  3. wchar_t* profileUserName = U("Admin");
  4. const wchar_t* profilePassword = U("");
  5.  
  6. http::client::credentials cred(profileUserName,profilePassword);
  7.  
  8. config.set_credentials(cred);
  9. http_client client(U("http://localhost:8091"),config);
  10. // create header
  11. http_request req(methods::GET);
  12. // Add base64 result to header
  13. req.headers().add(L"Authorization", L"Basic XYZtaW46Wr6yZW0xMAXY");
  14. //req.headers().add(L"Admin", L"");
  15. req.set_request_uri(L"/api/v1/Dimensions");
  16. pplx::task<http_response> responses = client.request(req);
  17. pplx::task<web::json::value> jvalue = responses.get().extract_json();
  18. wcout << jvalue.get().as_string();
Add Comment
Please, Sign In to add comment