Conneg with a redirection twist

An article on Cool URIs for the Semantic Web shows the use of content negotiation with a redirection twist.

A client operating on the 'platonic' URI gets redirected to the distinct URI:

HTTP/1.1 302 Found
Location: http://www.acme.com/people/alice.en.html

Although i think a 303 or 307 should be used to avoid ambiguity when PUT, POST and DELETE are used (the differences between the two are most excellently described in RESTful Web services).

As recommended by RESTful Web services when operating on a distinct URI the 'platontic' URI can be referred to using the Content-Location header.

This connects the 'platonic' and distinct URIs both ways which is, at least, intellectually satisfying. However, i doubt it would solve the content negotiation issues that Joe (that Sam linked to in a blog comment) and Norm ran in to but it may help to resolve the problem.

I am sort of flip-flopping about all this. Content negotiation is very powerful when used correctly, but can cause problems that are tricky to resolve with 'broken' clients/services. URIs can be consumed by other services in ways you don't expect. In any case i see the motivation and value in 'distinct' URIs more so than i did before.

Comments:

I'm not sure I agree that 307 is appropriate here, but upon POST, I agree that 303 is the right status code to use. I also agree that distinct URIs with the option to GET a "platonic URI" that redirects to one of the distinct ones based on the request parameters ('Accept' header et al). It should be made very explicit what properties the distinct URI you've arrived at have, and it should be easy to navigate from that one to another with other properties (a different language, for instance). Such navigation must be allowed through hypertext in the response entity as well as a modification of the request parameters and a new GET to the platonic URI. I think such a system could work very well. The problem is that it's currently not a defined way to accomplish this. I think we need a specification for a profile that defines this behaviour. If I had free time on my hands, I'd write up an I-D for it.

Posted by Asbjørn Ulsberg on May 31, 2007 at 07:40 AM CEST #

Asbjørn, i agree a 307 would force the client to re-POST the request. </br> Like you i have no (or very little) free time to pursue the definition of such a profile, but it certainly would be a useful exercise to specify one.

Posted by Paul Sandoz on June 01, 2007 at 03:04 AM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

sandoz

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today