While searching for a guide I found this example on Wikipedia

GET /dir/index.html HTTP/1.0
Host: localhost
Authorization: Digest username="Mufasa", realm="[email protected]", nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093", uri="/dir/index.html",

(it would be great if there is a tool/site that converts requests from this form raw requests to curl command)

this the realm and nonce when I try to send a normal get request to the site.

 WWW-Authenticate: Digest realm="device1",nonce="3c5d8f92f03d9f1afd5dd55a7b172ee8", qop="auth", algorithm="MD5"

the response but from a network capture screen shot

After searching online again for a little bit I got that the command should be like this 

curl "url" --digest -u {username}:{pass} -vv -d @4.xml -H "Content-Type: text/xml;charset=utf-8" 

but I didn't get where to put the nonce or the realm or the qop or algorithm="MD5"

while the .xml file contain the post data (in my case it's a soap action)

2 Answers 2


You don't have to specify all those values anywhere. The only thing you do have to is username/password pair. CURL takes care of computing the client response for you. This is exactly what "supporting of digest authentication" means for any client.

answer by user Alexey R. from stack over flow

in addition by a user on another site the command should look like this

curl -v  'https://jigsaw.w3.org/HTTP/Digest/' --digest -u guest:guest --form data=blahblah
  • 2
    Instead of digest you can use anyauth I think.
    – Timo
    Sep 28, 2021 at 12:31
  • 1
    @Timo yeah both works but anyauth sends two requests instead of one to check for info first
    – mina nageh
    Oct 2, 2021 at 20:25

When using Digest authentication, you need to send an HTTP "Authorization" header, and this header is where the nonce etc should go.

However, Digest uses a challenge/response mechanism that requires the Authorization header to be sent in a second HTTP request, rather than in the original HTTP request.

The second HTTP request can only be sent once the original HTTP request has received a 401 response.

You should be able to get the idea from this closed GitHub issue where it's explained further about the way curl works with this.

  • nope this issue have nothing to do with my problem but i figured it out anyway.
    – mina nageh
    Aug 3, 2020 at 15:50
  • hey @minanageh that's cool, why don't you post an answer with what the solution was in your case. It will help others with that problem in the future.
    – Reg Edit
    Aug 3, 2020 at 19:28
  • ok...................done
    – mina nageh
    Aug 4, 2020 at 1:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .