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