我有以下可用的Curl命令:
curl -H "Authorization:GoogleLogin auth=xxx" http://www.google.com/reader/api/0/user-info我正在尝试通过BubbleWrap HTTP中的get来完成此操作:
HTTP.get("http://www.google.com/reader/api/0/user-info",
{
:headers => { "Authorization:GoogleLogin auth" => "xxx"}
}) do |response|
puts response
puts response.body.to_str
end但是我得到了一个401,所以也许我没有正确地设置头部?
发布于 2013-01-06 16:29:46
标头名称应该是值为GoogleLogin auth=xxx的Authorization。这样做的方法是,它是一个头名称Authorization:GoogleLogin auth,其值为xxx。试着这样做:
:headers => {"Authorization" => "GoogleLogin auth=xxx"}https://stackoverflow.com/questions/14176770
复制相似问题