[help] - HTTP POST redirect

66 views
Skip to first unread message

Vikas Saroha

unread,
Jul 14, 2015, 1:47:49 AM7/14/15
to rubyonra...@googlegroups.com
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

Hassan Schroeder

unread,
Jul 14, 2015, 10:27:28 AM7/14/15
to rubyonrails-talk
Yes - see the HTTParty docs :-)

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan
Consulting Availability : Silicon Valley or remote

Sadaf Noor

unread,
Jul 14, 2015, 2:57:30 PM7/14/15
to rubyonra...@googlegroups.com
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 method.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/27c4466d-ac5b-474b-b445-dd0f5711139c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
 Md. Sadaf Noor (@sadaf2605)
 www.sadafnoor.com
Reply all
Reply to author
Forward
0 new messages