Tag: rest 客户

使用Rest Client Ruby Gem的身份validation标头

我已经创建了一个基本的身份validation密钥,现在我只是想利用它。 我尝试了一些不同的变体,但似乎都没有在请求标头中显示授权。 $auth = ‘Basic cmFtZXNoQHVzYW1hLmNvbTpyYW1lc2h1JEBtcA==’ @response = resource.post(‘Authorization’ => $auth) nor @response = resource.post(:authorization => $auth) nor @response = resource.post(:Authorization => $auth) nor @response = resource.post(:content_type => :json, :accept => :json, :headers => { ‘Authorization:’ => $auth }) 不幸的是,我没有在rdoc中找到很多可以帮助我解决这个问题的信息。 有没有人有使用Rest Client gem添加auth标头的经验?