如何使用curl测试摘要认证,如此处所述? 我能够通过将Authorization标头设置为Basic {SECRET}来测试简单基本示例,其中SECRET是Base64 :: encode64(“username:password”),如此处所述。 我尝试发送具有相同值的Authentication标头,但在调用authenticate_or_request_with_http_digest的行上获得NoMethodError(undefined method 'unpack' for nil:NilClass) 请问有人可以解释我在这里做错了什么吗?
最终我成功解决了这个问题。以下是我使用curl测试http基本认证和摘要认证的方法:curl --data {"red":"00"} --digest -u "username:password" "http://localhost:3000/api/statistics"