What C++ library should I use to implement a HTTP client? [closed]
I'm looking for a C++ library that implements or enables the implementation of a HTTP client. It should handle cookies as well.
What would you propose?
Curl++: is an option, particularly if you want things in more of a C++ style.
cpp-netlib: very good and simple to use, available on ubuntu
sudo apt-get install libcppnetlib-dev
example:
using namespace boost::network;
using namespace boost::network::http;
client::request request_("http://127.0.0.1:8000/");
request_ << header("Connection", "close");
client client_;
client::response response_ = client_.get(request_);
std::string body_ = body(response_);
Take a look at Poco Libraries.
I started using them as they are portable and it's a joy to work with. Simple and clean - though I haven't dived in anything fancy for the moment.
- curl
- libwww
C++ (STL) does not have a HTTP or network library by default, you will have to do with something else.
libcurl should do what you want. cURL++ is the same libcurl wrapped in a shiny C++ wrapper.