GET
- typically used when you access a page via a link (ie you cut and
paste into the web browser)
- all the values (ie form arguments) get passed in the url itself
( delimited by the ampersand character)
- example: when the following link is copied and pasted to the web
browser, a GET request is generated and the values for
distance,N,Make , state and so forth are passed in the url itself.
http://www.carsales.com.au/used-cars/MITSUBISHI/LANCER/private-results.aspx?distance=25&N=4294964597+0+4294966896+4294803479&Make=MITSUBISHI&state_id=0&Model=LANCER&State=All%20States
POST
- can only be generated by a form's submit action/button
- all the values (ie form arguments) get passed in the "params" hence
in rails, you access the values via "params"
- example: in search forms or registration forms, clicking the submit
button generates a POST request to the web server
Gordon Yeong
On Aug 2, 3:01 pm, Musdev Musdev <li...@ruby-forum.com> wrote:
> HEY Guys,
>
> Im new to rails. Can someone help explain POST and GET inrails, and
> maybe give an example? When is it used? Im learning rails via Agile web
> Development with Rails, and soon to download peepcode video's, are these
> good resources to learn from?
>
> Regards
> --
> Posted viahttp://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment