2

I would also like to have an opportunity to add/modify HTTP GET headers, but basically I just need to download a page with given URL.

P. S. The only reason I'm searching for an alternative to libcurl is it doesn't give me the kind of download speeds I need.

Violet Giraffe
  • 32,368
  • 48
  • 194
  • 335
  • 3
    What's wrong with libcurl? Besides, do you need a platform-independent library or it can be platform-specific? – Matteo Italia Nov 23 '11 at 16:14
  • Good point. Cross-platform is preferred, but if there's something for windows only - I'd test it. – Violet Giraffe Nov 23 '11 at 16:22
  • 1
    libcurl is very, very cross-platform, it has a permissive license, and has the benefit of being well-established. Do you have some other requirements that it doesn't meet? (If you define your requirements, people can make better suggestions.) – Cascabel Nov 23 '11 at 16:27
  • @Matteo Italia: There's nothing wrong with libcurl except I can't squeeze any decent performance (download speed) out of it, even guys from libcurl's mailing list couldn't help me. – Violet Giraffe Nov 23 '11 at 16:34
  • wondering why nobody mentioned cpp-netlib which is part of boost now !! – Arunmu Nov 23 '11 at 18:01
  • 1
    cpp-netlib has been improving at a steady pace and it is probably the best option already. However, it does *not* appear to be part of Boost yet. – Tronic Mar 19 '12 at 01:12

3 Answers3

5

Poco C++ has a HTTPClient class that is fairly easy to use. Here is their Networking tutorial. Poco C++ is also cross platform.

Here are some boost like recommendations from SO.

EDIT : If you haven't looked at Qt, they have a QNetworkRequest class. Seems a bit lower level than the Poco client, but might suit your needs. Here is an example using it.

mevatron
  • 13,911
  • 4
  • 55
  • 72
2

To add to the other answers, if you target only Windows you can use the the urlmon functions (included in Windows), like URLDownloadToFile or URLOpenBlockingStream.

Matteo Italia
  • 123,740
  • 17
  • 206
  • 299
1

libwww looks like it might fit what you are looking for.

Craig H
  • 7,949
  • 16
  • 49
  • 61