I'm trying to perform a post request and I'm trying to do it with the digest authentication. with libcurl
, I set the options:
curl_easy_setopt(curl_handle, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
curl_easy_setopt(curl_handle, CURLOPT_USERPWD, "username:password");
before setting all the other option (post, url and everything). The server closes my connection and I think that no digest is made. I just don't know how to automatically obtain the challenge-response behaviour of the digest. If I set HTTPAUTH
to CURLAUTH_BASIC
it encodes the stuff, I see with the VERBOSE option the header containing authorization = basic
. With digest no headers.
Do you know how can I do it, or can you give me some example? I really searched everywhere.
For a basic
POST
request you should do:For a multipart
POST
(a.k.amultipart/form-data
):Pro-tip: use
curl
command-line tool with--libcurl request.c
: it outputs into this C file the list of options used to perform the corresponding request.