I'm working to Open Stack in particular to Swift All in One (SAIO). I need to use C++ and libcurl for authentication.
Using curl via terminal I use this command (and it works);
curl -v -H 'X-Auth-User: $SWIFTACCOUNT:$SWIFTUSER' -H 'X-Auth-Key: $SWIFTPASSWORD'
How can I run this command with libcurl in C++?
Append
--libcurl code.c
to your command line and you'll get a fine first template to start off from!CURLOPT_HTTPHEADER is the option to curl_easy_setopt you need.
See also httpcustomheader.c for a full libcurl example using custom HTTP headers.