9

I know you can get parameters using params, but the thing is that it merges all parameters whether they were sent via GET or POST:

If you send a request via GET, no problem, the parameters can only be squeezed in the URL.

But if you send a POST request that has a URL like /blabla?foo=bar&foo2=bar2, is there a way to tell the difference between the variables sent via the URL and the variables sent through the actual POST method?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Etienne
  • 93
  • 1
  • 3
  • 1
    Seems that similar question has been asked already: http://stackoverflow.com/questions/152585/identify-get-and-post-parameters-in-ruby-on-rails – Miki May 27 '11 at 11:13
  • In that link, he asked how to get the request method. In my question I wanted to know how to tell the difference from a variable standpoint :) – Etienne May 28 '11 at 01:51

1 Answers1

12

Yes, in your controller you can get the GET parameters using request.GET and the POST parameters with request.POST

Mark
  • 1,058
  • 10
  • 13