Understanding ofxCurl

I need a bit of help understanding how to use ofxCurl beyond what the example offers. Say I have the following curl request (I realize I can run this command-line request with the system() command, I just can’t now because it doesn’t allow me certain capabilities libcurl offers):

curl -c cookies.txt -b cookies.txt -k https://www.example.com/ajaxauth/login -d 'identity=email@example.com&password=pa$$w0rd&query=https://example.com/data/format/json' > ~/Documents/of_v0.8.3_osx_release/apps/myProject/myProject/bin/data/myData.json"

  1. Filling in a log-in form: what class methods should be used to handle username/email and password to specified url?

  2. I don’t get how to use the type of options that are available with curl command-line tool, like the following:
    2a. -c ( --cookie-jar <filename>) and -b ( --cookie <name=data>): How to write/retrieve cookie to/from file (for staying logged-in for the next request)? Is this not necessary when using the library?
    2b. -k (--insecure): how to disable SSL verification?

I’ve tried going straight to using the libcurl library itself, but I’m too inexperienced with C++ for that to be as simple as some claim it to be :smile: … so before I commit to that I figured it’d be worthwhile to at least ask about this. Any tips greatly appreciated!

Have you tried ofxHTTP? It has a bit simpler syntax and examples for POST, GET, PUT, etc. You can also enable cookie support.

So I’m clearly still new-ish to c++ and thus wasn’t able to figure out how to implement ofxHTTP before discovering that fork() and execlp() system calls would help me achieve exactly what I wanted (which was to make a sort of “daemon” process of downloading a bunch of data while simultaneously animating a loading screen). Thanks anyway though, ofxHTTP on my radar for future use.