Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method GET and params #2

Open
oscherler opened this issue May 21, 2012 · 1 comment
Open

Method GET and params #2

oscherler opened this issue May 21, 2012 · 1 comment

Comments

@oscherler
Copy link

Is it normal that, as opposed to POST, the GET method doesn’t take parameters in the params hash?

client.connect( :get, '/hello.json', { 'foo' => 'bar' } ).json
# => {"message"=>"Hello, world!", "code"=>200, "result"=>{"__route__"=>"/hello.json"}} 

client.connect( :get, '/hello.json?foo=bar' ).json
# => {"message"=>"Hello, world!", "code"=>200, "result"=>{"__route__"=>"/hello.json", "foo"=>"bar"}}
@jo
Copy link

jo commented Oct 17, 2013

Fyi this is coded in OAuth::Consumer#create_http_request:

# create the http request object for a given http_method and path
def create_http_request(http_method, path, *arguments)
  http_method = http_method.to_sym

  if [:post, :put].include?(http_method)
    data = arguments.shift
  end
  ...
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants