Last active
March 20, 2020 10:53
-
-
Save igotit-anything/efa7fa80b644ac4224b780075fde180a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cpprest/http_client.h> | |
#include <cpprest/filestream.h> | |
#pragma comment(lib, "cpprest141_2_10.LIB") | |
using namespace std; | |
using namespace utility; // Common utilities like string conversions | |
using namespace web; // Common features like URIs. | |
using namespace web::http; // Common HTTP functionality | |
using namespace web::http::client; // HTTP client features | |
using namespace concurrency::streams; // Asynchronous streams | |
void GetHttp() | |
{ | |
http_client client(U("http://google.com")); | |
auto resp = client.request(U("GET")).get(); | |
wcout << U("STATUS : ") << resp.status_code() << endl; | |
wcout << "content-type : " << resp.headers().content_type() << endl; | |
wcout << resp.extract_string(true).get() << endl; | |
} | |
int main() | |
{ | |
GetHttp(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://igotit.tistory.com/2505