I've been searching for a C++ network library on SO. My application just needs to make a few HTTPS GET requests (https://some.domain.com/api.json?a=foo&b=bar) and parse the JSON response, that's it. These are my constraints.

  1. Can be compiled/built with GCC (CentOS 5.7) and VS2005.
  2. If it uses Boost, I only have Boost 1.44 and not likely to upgrade for now.
  3. Qt 4.4.3

So far I found these libraries, but would like the community to give some advises.

  1. libcurl: C style api interface, this is fine. Needs OpenSSL. curlpp looks promising, but is it still under maintained (last update was in 2009)?
  2. cpp-netlib: Needs OpenSSL. Pros: C++ style interface. Cons: Seems less stable and features than libcurl. And might not compatible with Boost 1.44 as the official site suggests to use Boost 1.5 and above.
  3. Boost::asio: too low level.
  4. Qt
  5. POCO: not sure if this is too overkill for a simple HTTPS GET.
有帮助吗?

解决方案

I'd go with libcurl any day. It is the most complete library in respect to protocols, ported to numerous platforms, and you really only pay for what you use. Of course you'll also be needing OpenSSL for secure protocols like HTTPS.

On the other hand, if you already have bloated your application with Qt, you might be better served using the QSSLSocket to retrieve the data and QScriptEngine to parse the JSON.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top