Testing basic http authenticaation with digest using curl
How can we test authentication with digest as explained here using curl?
I am able to test Simple Basic example by setting Authorization header to Basic {SECRET} where SECRET is Base64::encode64("username:password") as explained here
I tried sending Authentication header with same value but getting NoMethodError (undefined method 'unpack' for nil:NilClass) on line having call authenticate_or_request_with_http_digest
Would anyone please explain what I am doing wrong here?
Answers
Finally I am able to fix the problem. Here is how I used curl to test http basic authentication with digest
curl --data {"red":"00"} --digest -u "username:password" "http://localhost:3000/api/statistics"