Re: Content types and links

Peter Williams <[email protected]>
Newsgroups gmane.comp.web.services.rest
Message-ID <CAK5Vdzw3pfQOY0fnynqC8MB5asEOJqZy+EeV-jc6wJUs_y3DrQ@mail.gmail.com>
On Thu, Sep 6, 2012 at 3:18 PM, Greg Young <[email protected]> wrote:
>
> Would it seem off to you that I gave you the alternates?

Putting alternate links in the body is ok, but putting them in the
HTTP header as link header fields[1] would better. It would make them
visible to clients that do not understand how to interprete your
particular flavor of JSON. Those clients are likely to be the ones
that need alternate links the most.

Also, you should strongly consider identifying your flavor of JSON
with a vendor media type. Doing so allows clients to request (and
interprete) its particular semantics. Having a specific media type is
particularly helpful if/when you are going to serve more than one
flavor of JSON. For example, if a standard atom+json ever really did
come to fruition you would probably want to support both, for a while
at least.

[1]: http://tools.ietf.org/html/rfc5988

Peter
barelyenough.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.