[help] - HTTP POST redirect

Hello friends,

I am looking for some help on making a POST request from the controller
to
an external server and follow the redirect.

I am using -

response = HTTParty.post(external_uri, post_params)

but this does not redirect.

Is there an easy way this could be done.

thanks

On Mon, Jul 13, 2015 at 8:55 PM, Vikas S. [email protected] wrote:

I am looking for some help on making a POST request from the controller to
an external server and follow the redirect.

I am using -

response = HTTParty.post(external_uri, post_params)

but this does not redirect.

Is there an easy way this could be done.

Yes - see the HTTParty docs :slight_smile:


Hassan S. ------------------------ [email protected]

twitter: @hassan
Consulting Availability : Silicon Valley or remote

It did not redirect because it was not suppose to! You asked it to
respond
on a send a post request so it did. Now if you want to redirect then you
may need to use redirect_to
http://api.rubyonrails.org/classes/ActionController/Redirecting.html
method.

2015-07-14 9:55 GMT+06:00 Vikas S. [email protected]:

To view this discussion on the web visit

https://groups.google.com/d/msgid/rubyonrails-talk/27c4466d-ac5b-474b-b445-dd0f5711139c%40googlegroups.com

https://groups.google.com/d/msgid/rubyonrails-talk/27c4466d-ac5b-474b-b445-dd0f5711139c%40googlegroups.com?utm_medium=email&utm_source=footer

.
For more options, visit https://groups.google.com/d/optout.


Md. Sadaf N. (@sadaf2605 https://twitter.com/sadaf2605)
www.sadafnoor.com