0

I have a controller action that is triggered by a GET route, which under some conditions, I want to redirect to the POST route of another app on another server.

I'm aware of redirect_to "http://somewhere.com/thing_to_post_to" but there doesn't seem to be a way of specifying the http method. This intended for AJAX requests not pages, so it isn't acceptable to return a javascript to direct the browser.

Is this possible?

Nat
  • 2,689
  • 2
  • 29
  • 35

1 Answers1

1

redirect_to uses HTTP status code to make the redirection, so it would likely be a GET, here's antoher explanation to use 307 status code

Response.Redirect with POST instead of Get?

but is not very well implemented among all browsers, so i suggest using a session variable to pass parameters among the views or something similar.

Community
  • 1
  • 1
delagroove
  • 277
  • 3
  • 8
  • thanks, probably easiest for me to edit the routing at the other end to just use get even though it's a create action, not the same aesthetic, but it works. – Nat Aug 15 '12 at 18:39