From: boo boo Date: 2011-03-09T04:50:23+09:00 Subject: Re: http post and authorization header for twitter 7stud -- wrote in post #986265: > boo boo wrote in post #986243: >> here are my headers. am i doing this correctly? >> >> @headers = { 'oauth_nonce' => @current_nonce, >> 'oauth_callback' => @encoded_callback, >> 'oauth_signature_method' => "HMAC-SHA1", >> 'oauth_timestamp' => @current_timestamp, >> 'oauth_consumer_key' => @oauth_consumer_key, >> 'oauth_signature' => @encoded_oauth_sig, >> 'oauth_version' => "1.0"} > > Those don't look like http headers. Http headers look like > "Content-Type", "Cookie", etc. In addition, headers are strings--in > fact everything you send in a request is a string, so I don't know what > those arrays are. > > You said you need to POST the request. Is that data you are supposed to > send in the body of the request? Once again, it has to be a string, not > a ruby array. On the twitter doc it says: Now that we have our signature, we have everything we need to make the request to the endpoint https://api.twitter.com/oauth/request_token. Now we just generate an HTTP header called "Authorization" with the relevant OAuth parameters for the request: OAuth oauth_nonce="QP70eNmVz8jvdPevU3oJD2AfF7R7odC2XJcn4XlZJqk", oauth_callback="http%3A%2F%2Flocalhost%3A3005%2Fthe_dance%2Fprocess_callback%3Fservice_provider_id%3D11", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1272323042", oauth_consumer_key="GDdmIQH6jhtmLUypg82g", oauth_signature="8wUi7m5HFQy76nowoCThusfgB%2BQ%3D", oauth_version="1.0" Ok ill try passing as string... -- Posted via http://www.ruby-forum.com/.