2

When doing 303 redirects after a POST, RFC 2616 mentions adding a hyperlink in the body of the response (i.e. the POST's 303 response body, not the response of the subsequent GET on newly created resource).

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).

I have two questions about this:

  1. Are there any implementations (browsers or otherwise) that make use of such a link in the body of a 303?

  2. If adding a link to the body, what would the most appropriate link relationship be? rel="self", rel="alternate" ? Neither seems totally appropriate. I realize there may not be a standard link relation for something like this, and if that is the case, so be it.

Community
  • 1
  • 1
deontologician
  • 2,764
  • 1
  • 21
  • 33

1 Answers1

1

1) I believe all common browsers will display the response for a POST->303, although this may not be the case for GET (see http://greenbytes.de/tech/tc/httpredirects/#t303body)

Julian Reschke
  • 40,156
  • 8
  • 95
  • 98
  • 1
    Most browsers will display the response body on a 303 *if* they don't follow the redirection to the URI specified in the LOCATION header. In practice, 303 is pretty broadly supported, so the cases where this is a valuable practice are probably pretty rare. – EricLaw Aug 20 '12 at 18:44
  • Eric: see test case above -- IE doesn't appear to show the body on a GET response (it probably *does* on a POST response) – Julian Reschke Aug 21 '12 at 14:11