Unfortunately, standard C + + library provides no tools for working with HTTP protocol. Therefore, when we want to run some REST service, parse a webpage or write a simple bot or web crawler, we always wonder W Hich Library is better and faster on use. Sometimes a project already uses some framework (or even several). But how does we create an HTTP request using available facilities? Not-to-get confused each time performing such tasks, I decided to make a cheat sheet with examples of HTTP requests in C + + Using different libraries. I guess Kukuruku is the best place for keeping such cheat sheets.
We ' re going to take a look at the following libraries:
WinInet
WinHttp
Casablanca
Qt
POCO
WxWidgets
Boost.asio
Libcurl
Neon
. NET (С++/CLI)
Ixmlhttprequest
Happyhttp
Cpp-netlib
WinInet
website:http://msdn.microsoft.com/en-us/library/windows/desktop/aa385483 (v=vs.85). aspx
Platform:windows and later
Example
WinHttp
website:http://msdn.microsoft.com/en-us/library/windows/desktop/aa382925 (v=vs.85). aspx
Platform:windows and later
Example
Casablanca
Website:https://casablanca.codeplex.com
Platform:all
Example
Qt
website:http://qt-project.org
Platform:all
Example Use for Qt 4.x (already outdated)
Example Use for Qt 5.x
POCO
website:http://pocoproject.org
Platform:all
Example
WxWidgets
website:http://www.wxwidgets.org
Platform:all
Example
Boost.asio
Website:http://www.boost.org/doc/libs/1_55_0/doc/html/boost_asio.html
Platform:all
Example
Libcurl
Website:http://curl.haxx.se/libcurl
Platform:all
Example
Neon
Website:http://www.webdav.org/neon
Platform:all
Example
. NET
Website:http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx
Platform:windows XP and later
Example
Ixmlhttprequest
website:http://msdn.microsoft.com/en-us/library/ms759148 (v=vs.85). aspx
Platform:windows XP and later
Example
Happyhttp
Website:http://scumways.com/happyhttp/happyhttp.html
Platform:all
Example
Cpp-netlib
website:http://cpp-netlib.org
Platform:all
Example
It's high time-to-Find out the Perfect one!
If you want the trusted Classics–use libcurl. If you ' re writing an application with a visual Interface–use Qt. For those writing inс++11, Casablanca are the best choice. If you ' re writing under. NET and then you should use the standard platform facilities. But if you ' re writing something with no interface and besides a HTTP client you want to has various handy tools as well, Use Boost or POCO.
A Cheat Sheet for HTTP Libraries in C + +