[Zope] Re: Can ZPT form call a url?

Tres Seaver tseaver at palladion.com
Wed May 25 07:40:05 EDT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Phillip Hutchings wrote:
>>The easiest way it to perform a redirect.
>>
>>Unfortunately, HTTP allows automatic redirects only for "GET" requests.
>>But, if you can live with "GET", then it is very easy.
> 
> 
> Fortunately, most web browsers are lax and let you do this. Safari is
> not, but the warnings are a bit obscure to most users, as a 302
> response technically means to repost the data to a new URL - hence
> Safari's 'do you want to resend this data' question.
> 
> A 303 response should be used to redirect a POST request. The user is
> still supposed to be asked if they want to follow the redirect, but I
> bet most browsers won't, as the specs are ambiguous.

HTTP 1.1 isn't ambiguous about 303:  it defines that response code for
exactly that usecase[1]:

 10.3.4 303 See Other

 The response to the request can be found under a different URI and
 SHOULD be retrieved using a GET method on that resource. This method
 exists primarily to allow the output of a POST-activated script to
 redirect the user agent to a selected resource. The new URI is not a
 substitute reference for the originally requested resource. The 303
 response MUST NOT be cached, but the response to the second
 (redirected) request might be cacheable.

 The different URI SHOULD be given by the Location field in the
 response. Unless the request method was HEAD, the entity of the
 response SHOULD contain a short hypertext note with a hyperlink to the
 new URI(s).

      Note: Many pre-HTTP/1.1 user agents do not understand the 303
      status. When interoperability with such clients is a concern, the
      302 status code may be used instead, since most user agents react
      to a 302 response as described here for 303.



[1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html


Tres.
- --
===================================================================
Tres Seaver                                   tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFClGQV+gerLs4ltQ4RAoV5AJ9zhh7KQlMCu7CyAqPC/tX0BGbu5gCfdpZD
gLvgYuldYpCuugugzYx99Kg=
=Hw6n
-----END PGP SIGNATURE-----



More information about the Zope mailing list