resource = RestClient::Resource.new('http://protected/resource', 'user', 'pass')
我已经看到了上面的链接,当我使用ruby进行http基本身份验证时。但我的问题是如何检索和解码此用户并传递登录目的?
答案 0 :(得分:1)
如果您要使用Rails实现服务器端,http_basic_authenticate_with就是您要找的。见ActionController::HttpAuthentication::Basic