Re: Is it correct to respond with partial representation for low capabilities media-types?
Mike Kelly <[email protected]>
| Newsgroups | gmane.comp.web.services.rest |
|---|---|
| Message-ID | <CANqiZJZ6RSecr5BN9jVp7H0=hs6BAr_gfFrygzAnXPuA5tnmeQ@mail.gmail.com> |
On Thu, Jun 21, 2012 at 12:49 PM, Jan Algermissen <[email protected]> wrote: > > On Jun 21, 2012, at 5:33 AM, Philippe Rathé wrote: >> What are the downsides of making use of such non first-class >> hypermedia representations? > > None really. I assume one of the reasons for Link headers being there is exactly that. There are a few downsides to using Link headers to drive your application: - There are limits to the size of HTTP header fields that you will run up against - You are making people work harder to interact with your application e.g. there is a relatively low amount of tools available for working with Link headers - Expressing links with a Context IRI that is distinct from the Effective Request URI is cumbersome e.g. representing a set of items and each of their links is a pain with Link headers. - iirc, some intermediaries do nasty things to headers that could introduce bugs in your application Link headers are good for layering generic protocols on top of HTTP (e.g. Linked Cache Invalidation) and for adding hypermedia to HTTP responses with a content-type that has no linking capability, but it's probably best to avoid using them when they aren't necessary - there are generic media types for linking available now that you can use to drive your app without having to resort to the Link headers. Another issue to think about (although not really a technical argument) is that if you are designing an application which is intended to be driven by hypermedia, then stuffing the links up into headers and 'out of the way' could be sending out the wrong signal to clients of your application. Cheers, M