6

如何使用curl来测试使用摘要的身份验证here使用curl测试使用摘要测试基本http认证

我能够通过设置来测试Simple Basic例如AuthorizationBasic {SECRET}其中SECRETBase64::encode64("username:password")作为解释here

我试图发送Authentication头用相同的价值,但在网上有电话获取NoMethodError (undefined method 'unpack' for nil:NilClass)authenticate_or_request_with_http_digest

会有人请解释我在这里做错了什么?

回答

18

最后我能够解决这个问题。这里是我用卷曲测试http基本认证与摘要

curl --data {"red":"00"} --digest -u "username:password" "http://localhost:3000/api/statistics" 
+0

没有工作,但这工作:http://stackoverflow.com/a/35892984/365675 – yetanothercoder