Is there a way to create an HTTP POST redirect? So when the user is redirected, the browser visits that URL but POSTs to it instead of GETting it. Pat --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Pat Maddox wrote:> Is there a way to create an HTTP POST redirect? So when the user is > redirected, the browser visits that URL but POSTs to it instead of > GETting it. > > PatI think if the browsers sends a POST and then gets a 301 redirect response, the browser will POST the same thing to the redirected url as well. I don''t think there is a way to force the browser to send a POST after being redirected from a GET. -- Posted via http://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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 2/12/07, Alex Wayne <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Pat Maddox wrote: > > Is there a way to create an HTTP POST redirect? So when the user is > > redirected, the browser visits that URL but POSTs to it instead of > > GETting it. > > > > Pat > > I think if the browsers sends a POST and then gets a 301 redirect > response, the browser will POST the same thing to the redirected url as > well.I just did a brief demo and the browser will GET the redirected URL. Bummer. Any other ideas? Pat --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You can try doing this using curl. This example is in php but there''s a ruby lib out there too. $g = curl_init(); curl_setopt($g,CURLOPT_URL,''http://urltopostto.com''); curl_setopt($g, CURLOPT_POST, 1); curl_setopt($sessions,CURLOPT_POSTFIELDS,"foo=bar&andy=cool); print curl_exec($g); You could also do this by loading a page using a GET then using javascript to click on a form post button on the window load. Andy On Feb 12, 2007, at 10:55 AM, Pat Maddox wrote:> > On 2/12/07, Alex Wayne <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> >> Pat Maddox wrote: >>> Is there a way to create an HTTP POST redirect? So when the user is >>> redirected, the browser visits that URL but POSTs to it instead of >>> GETting it. >>> >>> Pat >> >> I think if the browsers sends a POST and then gets a 301 redirect >> response, the browser will POST the same thing to the redirected >> url as >> well. > > I just did a brief demo and the browser will GET the redirected URL. > Bummer. Any other ideas? > > Pat > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---