RFC 2616 :-) http://www.ietf.org/rfc/rfc2616.txt (2626 is the Y2K RFC)
Sopasakis -- as HTTP itself doesn't have a means of specifying a delay
before a redirect, you won't get consistent behavior across every HTTP
compliant client or library. Most user-agents will act immediately on an
HTTP redirect status code (3xx) and ignore the entity, but supplying an HTML
entity with the meta refresh tag may have the desired effect for some
user-agents.
The usual convention is to enclose a short HTML entity with a 3xx redirect,
something like this:
<html><head><title>Moved</title></head><body>
Please click this link if you are not automatically redirected to: <a
href="${new-location}">${new-location}</a>
<script>window.location.href="$[new-location}";</script>
</body>
You can doctor up some variants of this using the meta refresh or Javascript
timeouts, but I suspect getting consistent behavior across basic HTTP
clients like curl and regular browsers like Firefox will be a challenge,
since you're operating at the HTML/JS level and not really the HTTP level.
If you find a great solution, please post it back!
- Rob
On Mon, Dec 28, 2009 at 1:42 PM, Matt Kennedy <[email protected]> wrote:
> If you want this to be an official HTTP redirect, for example a 301, 302,
> 303, 307 status code, then you can set that status code in the response
> object and set the entity to be some html that will do your refresh to the
> new URL, plus the countdown. Be careful if you choose to go with 301 or 302
> as the response code, read IETF RFC 2626 for details.
>
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2433464