2010-11-05 26 views
0

如何軌能搶到捲曲請求頭,如:從Rails的curl請求中抓取頭文件!

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 "[email protected]/path/to/file" http://localhost:3000/api/upload.xml 

抓住這些值:oauth_cosumeroauth_tokenoauth_timestamp

在此先感謝!

+0

你有整個請求的命令字符串,如上面? – 2010-11-05 20:29:06

+0

可能的重複[在我的Rails應用程序中與Twitter回聲&oauth的幫助](http://stackoverflow.com/questions/4074227/help-with-twitter-echo-oauth-in-my-rails-app) – shingara 2010-11-05 20:46:42

回答

0
headers['oauth_consumer_key'] 

等等