From: Mike Moore Date: 2011-03-09T05:21:19+09:00 Subject: Re: http post and authorization header for twitter On Tue, Mar 8, 2011 at 12:53 PM, 7stud -- wrote: > The http header name is "Authorization", so you have to write something > like: > > headers = {'Authorization' => ???} FWIW, the headers are the third parameter to Net::HTTP#post and should be a hash like 7stud shows. http://ruby-doc.org/stdlib/libdoc/net/http/rdoc/classes/Net/HTTP.html#M001391 boo boo, you seem to be having a difficult time generating a proper OAuth request, which is why you are getting that error. You are already requiring the oauth library, I'm curious why you don't just use that to calculate the signature and set the Authorization header for you? # WARNING: Untested code follows @consumer_key = 'MY KEY' @consumer_secret = 'MY SECRET' @callback = 'SITE or oob' consumer = OAuth::Consumer.new( @consumer_key, @consumer_secret, :site => 'https://api.twitter.com', :request_token_path => '/oauth/request_token', :authorize_path => '/oauth/authorize', :access_token_path => '/oauth/access_token', :http_method => :post) request_token = consumer.get_request_token( :oauth_callback => @callback) #request token is request_token.params[:oauth_token] #request token secret is request_token.params[:oauth_token_secret] puts request_token.authorize_url