I have been searching for days to find an Http Client in C++ that I can use. I am assisting in a research group involving camera recording based on sensor detection and am responsible for making the interface with the cameras. I have some work that was done before I joined, but it is all in java. I really need something to help get my foot in the door. If I could connect to the camera, login, and download an image, I'd have a good starting point. I'm not sure how the authentication works, but the java implementation used a method addBasicAuthentication (in this class http://www.innovation.ch/java/HTTPClient/api/HTTPClient/AuthorizationInfo.html). If anyone could help me get started with this, I'd really appreciate it.

8 Years
Discussion Span
Last Post by hazmatt

Thanks for the reply. I have install curl, and found a program to download a single file, but that's it. I don't know what to do for anything else, particularly for authentication.


Well you write a program which uses the library.

Short of suggesting you go up a level and say grab the source code for say 'wget', which will add a lot of stuff not particularly interesting to you, I dunno what to suggest.

There isn't an easy answer except get in there and start doing lots of reading and working things out.


Fair enough. Any particular place you suggest I start? Tutorial, man pages, documentation? Anything specific would be great.


If you've never done any network programming at all, begin with http://beej.us/guide/bgnet/

For the HTTP spec, read this - http://www.w3.org/Protocols/rfc2616/rfc2616.html

For any kind of network debugging, get http://www.wireshark.org/
All protocols involve sending lots of messages back and forth, and messing up any one of them will break things.

For example, if a normal desktop browser works, then use wireshark to trace the message interactions of the browser, then try to mimic that in your own code.

curlpp might help as well.


Packet sniffing was the best suggestion ever. I could not get curl's httpauth option working, but once I had all the headers, I figured out how to use the curlopt_httpheader option to set the headers being sent and could do authorization directly in the header. Thanks for your help.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.