Skip to content

Instantly share code, notes, and snippets.

@yasuharu519
Created January 8, 2015 00:41
Show Gist options
  • Save yasuharu519/9128c54351ef5599b707 to your computer and use it in GitHub Desktop.
Save yasuharu519/9128c54351ef5599b707 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <restclient-cpp/restclient.h>
static std::string test_url = "http://www.google.com";
int main()
{
auto res = RestClient::get(test_url);
std::cout << "# Code" << std::endl;
std::cout << res.code << std::endl << std::endl;
std::cout << "# Header" << std::endl;
for (const auto& header : res.headers)
{
std::cout << header.first << ":" << header.second << std::endl;
}
std::cout << std::endl;
std::cout << "# Body" << std::endl;
std::cout << res.body << std::endl << std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment