Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Browser does GET instead of POST after redirect of CGI

0 views
Skip to first unread message

Peter Scott

unread,
May 29, 1999, 3:00:00 AM5/29/99
to
Browser: Netscape 4.6 for Win95. I don't know whether this is a bug
or a feature, maybe someone can help me out here. I have a form
that POSTs to a CGI script; said script returns a 302 redirect.
The browser calls the new URL with a GET instead of a POST and the
form arguments are lost. Seems like they should go to the new location.
If so, then maybe I'm missing something in how I do it.

Here's the dialog that takes place, with the uninteresting headers removed:

===== CLIENT:
POST /~psi/first.cgi HTTP/1.0

===== CLIENT:
Content-type: application/x-www-form-urlencoded
Content-length: 20

First=cat&Second=dog

===== SERVER:
HTTP/1.0 302 Found
Server: Netscape-Enterprise/2.01
Uri: http://server/~psi/second.cgi
Location: http://server/~psi/second.cgi
Content-type: application/x-www-form-urlencoded

===== CLIENT:
GET /~psi/second.cgi ### This is where I think it should send a POST
### and repeat the Content-length etc

===== SERVER:
HTTP/1.0 200 OK

About the only place I can think of where I might be getting it wrong
is in what Content-type I send back with my redirect. I've tried
sending text/html, and no header. No difference. Any ideas?

(Yes, it does need to be done as a 302 redirect; there are good reasons.)

--
This is news. This is your | Peter Scott, NASA/JPL/Caltech
brain on news. Any questions? | (p...@euclid.jpl.nasa.gov)

Disclaimer: These comments are the personal opinions of the author, and
have not been adopted, authorized, ratified, or approved by JPL.

0 new messages