Created
January 8, 2015 00:41
-
-
Save yasuharu519/9128c54351ef5599b707 to your computer and use it in GitHub Desktop.
test code for https://github.com/mrtazz/restclient-cpp
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 <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