从Rails中的curl请求中获取标题!

时间:2010-11-05 20:18:21

标签: ruby-on-rails twitter curl

rails如何抓取卷曲请求的标头,如:

curl -v -H 'X-Auth-Service-Provider: https://api.twitter.com/1/account/verify_credentials.json' -H 'X-Verify-Credentials-Authorization: OAuth realm="http://api.twitter.com/",
oauth_consumer_key="yTrEIQH6jhtmLUypg8T5", oauth_signature_method="HMAC-SHA1",  
oauth_token="514797-YuI8aYUDRmykzVKrgoLhXSq67TEa5ruc4GJC2rWTyu",oauth_timestamp="1271323750",
oauth_nonce="oYu6nMTQIZvqvlfXM56aBLAf5noGD0AQR3Fmi7U9Y", 
oauth_version="1.0", oauth_signature="CV4bTfE7Rs9J1kafTGwufLJdspo%3D"' -F "file=@/path/to/file" http://localhost:3000/api/upload.xml

抓住这些价值观:oauth_cosumeroauth_tokenoauth_timestamp等。

提前感谢!

1 个答案:

答案 0 :(得分:0)

headers['oauth_consumer_key']

等...