|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
|
|
|
Re: Inconsistencies in Discovery methodsOn Feb 6, 2009, at 4:03 PM, Eran Hammer-Lahav wrote: > On 2/6/09 11:03 AM, "Roy T. Fielding" <fielding@...> wrote: > >> There are many resources involved in HTTP, >> only one of which is identified by the requested URI. Each of those >> resources may have representations, and the meaning of the payload >> in a >> response message is defined by the status code. A 404 response is >> going >> to contain a representation of a resource on the server that >> describes >> that error. A 200 response is going to contain a representation of >> the >> resource that was identified as the request target. > > What this means is that a Link header in the HTTP response to a GET > request > might not be about the resource identified by the URI used to make > that > request. The Link header field defines what it is about: [RFC2068] The Link entity-header field provides a means for describing a relationship between two resources, generally between the requested resource and some other resource. It says "requested resource" there for a reason. It seems that has been muddled a bit in Mark's draft, probably because you guys have had too many discussions about what it could mean. If you think it would be helpful to distinguish the Link header field (resource metadata) from a Content-Link header field (representation metadata), then that is a separate discussion. ....Roy |
|
|
Re: Inconsistencies in Discovery methodsOn 07/02/2009, at 11:40 AM, Roy T. Fielding wrote: > On Feb 6, 2009, at 4:03 PM, Eran Hammer-Lahav wrote: >> On 2/6/09 11:03 AM, "Roy T. Fielding" <fielding@...> wrote: >> >>> There are many resources involved in HTTP, >>> only one of which is identified by the requested URI. Each of those >>> resources may have representations, and the meaning of the payload >>> in a >>> response message is defined by the status code. A 404 response is >>> going >>> to contain a representation of a resource on the server that >>> describes >>> that error. A 200 response is going to contain a representation of >>> the >>> resource that was identified as the request target. >> >> What this means is that a Link header in the HTTP response to a GET >> request >> might not be about the resource identified by the URI used to make >> that >> request. > > The Link header field defines what it is about: [RFC2068] > > The Link entity-header field provides a means for describing a > relationship between two resources, generally between the requested > resource and some other resource. > > It says "requested resource" there for a reason. It seems that has > been muddled a bit in Mark's draft, probably because you guys have had > too many discussions about what it could mean. Yes; this should be better in -04 (which is waiting for the IPR contributions clarification). > > > If you think it would be helpful to distinguish the Link header > field (resource metadata) from a Content-Link header field > (representation metadata), then that is a separate discussion. > > ....Roy > -- Mark Nottingham http://www.mnot.net/ |
|
|
RE: Inconsistencies in Discovery methodsThis solves my problem with regard to the Link header. On Feb 06, 2009 4:41 PM, "Roy T. Fielding" <fielding@...> wrote: > The Link header field defines what it is about: [RFC2068] > > The Link entity-header field provides a means for describing a > relationship between two resources, generally between the requested > resource and some other resource. Isn't this a bit of a contradiction? The same spec defines entity-header as: Entity-header fields define optional metainformation about the entity-body or, if no body is present, about the resource identified by the request. (which is identical to the language in the most recent draft without the word 'optional'). A 404 response can have an entity-body, which you defined as "representation of a resource on the server that describes that error". So a Link header on a 404 with no body is consistent between the Link header definition and the entity-header definition. But if a body is present, they contradict each other. > If you think it would be helpful to distinguish the Link header > field (resource metadata) from a Content-Link header field > (representation metadata), then that is a separate discussion. My use case needs a resource metadata field, so a Content-Link header would not be needed. This does not seem to help me with the case where a 404 response includes an HTML body with a <LINK> element, and a Link header. According to the explanation above, each has a very different context URI. The subject of the Link header is the requested resource, while the subject of the HTML <LINK> element is the "resource on the server that describes that error". So in order to keep the three methods synced (Link: header, <LINK> element, /site-meta), we would still need to restrict the HTTP status codes... this time because of <LINK> elements. EHL |
|
|
Re: Inconsistencies in Discovery methodsOn Feb 6, 2009, at 10:48 PM, Eran Hammer-Lahav wrote: > This solves my problem with regard to the Link header. > > On Feb 06, 2009 4:41 PM, "Roy T. Fielding" <fielding@...> wrote: > >> The Link header field defines what it is about: [RFC2068] >> >> The Link entity-header field provides a means for describing a >> relationship between two resources, generally between the >> requested >> resource and some other resource. > > Isn't this a bit of a contradiction? The same spec defines entity- > header as: > > Entity-header fields define optional metainformation about the > entity-body or, if no body is present, about the resource > identified > by the request. > > (which is identical to the language in the most recent draft > without the word 'optional'). > > A 404 response can have an entity-body, which you defined as > "representation of a resource on the server that describes that > error". So a Link header on a 404 with no body is consistent > between the Link header definition and the entity-header > definition. But if a body is present, they contradict each other. Yes, we had several "category errors" in 2068, largely because we chose the wrong names for the categories. Some of them were fixed in 2616, and they'll most likely be different in 2616bis. Don't worry about that. However, I think your attempt to make all types of links in the same message be mirrors is unnecessary. In many cases, the relation name will have implications beyond the resource being targeted, and in other cases the links will simply be wrong if expressed as resource metadata (e.g., a link rel="author" for which the relationship is only true for one of the representations of this resource). We could resolve that ambiguity by differentiating where the link is indicated (link: vs content-link, <link> vs <a>) or by differentiating the relation names (e.g., owner vs author). Neither option has been used consistently in the past and I doubt that it will ever be consistent in the future. ....Roy |
|
|
RE: Inconsistencies in Discovery methodsOn Feb 07, 2009 11:49 AM, "Roy T. Fielding" <fielding@...> wrote: > On Feb 6, 2009, at 10:48 PM, Eran Hammer-Lahav wrote: > > > A 404 response can have an entity-body, which you defined as > > "representation of a resource on the server that describes that > > error". So a Link header on a 404 with no body is consistent > > between the Link header definition and the entity-header > > definition. But if a body is present, they contradict each other. > > Yes, we had several "category errors" in 2068, largely because we > chose the wrong names for the categories. Some of them were fixed > in 2616, and they'll most likely be different in 2616bis. > Don't worry about that. How do you expect this contradiction to be resolved? Should the Link header simply override the meaning of 'entity-header' and be always considered 'about the request URI'? > However, I think your attempt to make all types of links in the same > message be mirrors is unnecessary. In many cases, the relation name > will have implications beyond the resource being targeted, and in > other cases the links will simply be wrong if expressed as resource > metadata (e.g., a link rel="author" for which the relationship is > only true for one of the representations of this resource). I am not. My focus is very narrow, and deals with a single relation type 'describedby' (unless this path takes me to a place that is not compatible with the ideas expressed by the POWDER spec, in which case I will mint a new relation type, like 'about'). I'm just trying to make all types of links in the same message identical. How different types of links should be used to express the same 'describedby' relation (context-type-target). From your reply it seems I can accomplish this rather easily by saying: A 'describedby' link from a resource URI (X) to its descriptor URI can be expressed by: * Link: headers in responses to requests where the request URI is X. * <LINK> elements where the document is a valid representation of the resource identified by URI X. * /site-meta templates for URI X's authority, where URI X is the transformation input. In the example we're discussing (404), the presence of a <LINK> element in the body is simply irrelevant. This approach removes any need to explicitly discuss the HTTP status code associated with the response. But for this to work, 2616bis will need to be very clear about which entity-body (based on the response status code) is a representation of the request URI and which is of something else. Am I asking for too much? EHL |
|
|
Re: Inconsistencies in Discovery methodsOn Feb 7, 2009, at 1:48 AM, Eran Hammer-Lahav wrote: > This solves my problem with regard to the Link header. > > On Feb 06, 2009 4:41 PM, "Roy T. Fielding" <fielding@...> wrote: > >> The Link header field defines what it is about: [RFC2068] >> >> The Link entity-header field provides a means for describing a >> relationship between two resources, generally between the >> requested >> resource and some other resource. > > Isn't this a bit of a contradiction? The same spec defines entity- > header as: > > Entity-header fields define optional metainformation about the > entity-body or, if no body is present, about the resource > identified > by the request. This makes me wonder if Link: in its reincarnation ought to be defined to be a response-header instead of an entity-header: The response-header fields allow the server to pass additional information about the response which cannot be placed in the Status- Line. These header fields give information about the server and about further access to the resource identified by the Request-URI. [RFC 2616] What would this break? I would guess that there are implications for CN and caching, but not sure whether the change would be an improvement or damaging. Jonathan |
| Free embeddable forum powered by Nabble | Forum Help |