Oct
22
It’s good to see Roy take on the pseudo/not-at-all “REST APIs” out there.
As I mentioned in a comment there, I’m no stranger to this kind of interface specification, as I’d guess that about 80% of the “APIs” I reviewed as a consultant suffered from at least one of the problems Roy listed. Fortunately, I found it wasn’t very difficult to get people to see the error of their ways. All I had to do was re-emphasize that REST requires that interfaces be uniform – the same – and therefore that pre-specifying anything specific about a resource, such as URI structure, response codes, media types, resource relationships, etc.. was antithetical to that requirement.
No related posts.
Thanks Mark,
I also read Roy’s post, and it was (rightfully) disciplinarian.
I want to get my API inline with REST completely. Most of the basics are covered (I think): keeping resources, methods, content types separate. GET, POST, PUT, DELETE. Digest Authentication where necessary.
My concern, and what I’m trying to find out more about, and where I don’t meet Roy’s standard, is when it comes to make resource relationships and URI’s discoverable. I.E. hypertext linking etc.
My representations are all in either JSON or XML. Obviously putting any kind of URI link in a JSON object is NOT discoverable. So it has to go in the header right? What would you suggest? More explanation regarding this subject would be very helpful. Forgive me if I’m asking for something you’ve already published.
I would suggest using a new media type that is built with JSON, but specifies where URIs go.
Thanks Mark.