On Mon, 8 May 2000, Jochen F. Rick wrote:
> Hello!
>
> This post is aimed at people who know things about HTTP. CoWeb often
> responds to a HTTP post. When people press the back button, the
> browser asks if you want to repost the data. Is there a way to stop
> this behaviour? For edits, I am able to stop this by sending a
> redirect. On others, such as search and attachments, I use the same
> URL and redirect doesn't work. Is there another solution? For
> instance, could I use another status code such as #created (201) or
> #accepted (202). If I can't find another solution, I will have to put
> in more redirections.
For searching, the best "fix" is to use url-encoded requests instead of
post. This also has the nice side-effect that users can construct a
search url and put it in a link. This is how I did it in my swiki.
Regarding the attachments - why does redirect not work? Did you try it?
Maybe you should answer 303. To quote RFC2068:
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 is not cachable, but the response to the second (redirected)
request MAY be cachable.
If the new URI is a location, its URL 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)
-- Bert