29 Jun 2011 20:46
29 Jun 2011 21:44
Re: sending a post request from a controller
If you're sending them along, isn't that a redirect, not a POST?
_______________________________________________ Camping-list mailing list Camping-list@... http://rubyforge.org/mailman/listinfo/camping-list
29 Jun 2011 22:43
Re: sending a post request from a controller
Can I send POST data along with a redirect? Dave On Wed, Jun 29, 2011 at 3:44 PM, Steve Klabnik <steve@...> wrote: > If you're sending them along, isn't that a redirect, not a POST? > _______________________________________________ > Camping-list mailing list > Camping-list@... > http://rubyforge.org/mailman/listinfo/camping-list > -- -- Dave
29 Jun 2011 23:00
Re: sending a post request from a controller
No, redirects are an HTTP response, they're not a new request.
Can you give a more concrete example? Your explanation sounds like you're trying to do two different things, and I'm not sure which you mean.
_______________________________________________ Camping-list mailing list Camping-list@... http://rubyforge.org/mailman/listinfo/camping-list
30 Jun 2011 02:34
Re: sending a post request from a controller
Jenna Fox <a <at> creativepony.com>
2011-06-30 00:34:12 GMT
2011-06-30 00:34:12 GMT
To illuminate the difference: User goes to website, webserver asks camping "What should I tell this guy?" camping goes to other website using Net::HTTP, talks to other website a bit, then hangs up and goes back to the web server who asked that question and says...? If you want the user to send a post request to another page, that's a bit tricky. Probably the best way to do it is to send them back a <form> with some <input type=hidden name=thing value=blah> type elements in it, then a little <script> which says: <script> document.forms[0].submit(); </script> at the end of the page. You should probably also include a submit button in the form for people with javascript turned off. On 30/06/2011, at 4:46 AM, David Susco wrote: > What's the cleanest way to do this? With Net::HTTP? I have a form > that's sent to a controller and validated. If its valid I'd like to > send the user on (along with the info they've entered) to an external > site to process payment. > > Thanks, > Dave > _______________________________________________ > Camping-list mailing list > Camping-list@... > http://rubyforge.org/mailman/listinfo/camping-list
30 Jun 2011 15:48
Re: sending a post request from a controller
Ideally I'd like a user to be able to submit a form to the camping app, having camping do all the validation and some preprocessing and then have the camping app send the user to an external site (with the post data) where the user can complete a payment. Dave On Wed, Jun 29, 2011 at 5:00 PM, Steve Klabnik <steve@...> wrote: > No, redirects are an HTTP response, they're not a new request. > Can you give a more concrete example? Your explanation sounds like you're > trying to do two different things, and I'm not sure which you mean. > _______________________________________________ > Camping-list mailing list > Camping-list@... > http://rubyforge.org/mailman/listinfo/camping-list > -- -- Dave
RSS Feed