News for hackers. Stuff that matters.
Re:API Design Guide by squeaky-clean on Wednesday February 22, 2017 @02:35PM (#13708471)
> Sure, a client can follow the links in an automated fashion, but how is it supposed to know what the resources actually are and which links it needs to follow, which resources it has to create or modify, to actually accomplish anything?

I've never understood this either. My API client isn't smart enough to follow links and write logic for me, so when they say "the client" can "discover", they must be referring to myself, and not my code? Well I'd much rather read documentation than click hyperlinks inside an API.

Re:API Design Guide by jalfresi on Thursday February 23, 2017 @05:11AM (#13712810)
This is because the idea is that you would create a new media-type to represent your resource. It is this media-type definition that would determine what rel-types there are and how a client should interpret them.

for example, the spec for the HTML media-type that when a client sees a link with the rel-type "stylesheet" is should fetch the resource using HTTP GET.

As REST requires that media-types be registered the idea would be that we would eventually get a set of media-types that cover things like audio playlists, and how to interact with them.

So any "intelligence" required by a client would be baked into the implementation of the media-type processor. Instead of "client libs" for specific web services, you would have a general media-type parser/processor which could be re-used by clients of different web services to process common media-types.

But apparently individual client libs for each web service that overloads JSON is better.

Re:API Design Guide by tokenizerrr on Thursday February 23, 2017 @06:09AM (#13713010)
> But apparently individual client libs for each web service that overloads JSON is better.

I mean, there are so many different types of resources and every API I interact with definitely invent their own. How often do you come across an API offering a playlist of music?

Re:API Design Guide by webmaven on Wednesday February 22, 2017 @07:06PM (#13710460)
You can find smarter clients by Googling "hypermedia client". Also, O'Reilly just published a book on the topic: http://shop.oreilly.com/product/0636920037958.do
Re:API Design Guide by RyanZAG on Thursday February 23, 2017 @04:16AM (#13712625)
But would anybody really want to use a hypermedia client versus a regular client? Of course not. The regular client can be optimized properly at the level it needs to be to make the user's interaction smoother.
Re:API Design Guide by webmaven on Thursday February 23, 2017 @11:24PM (#13720994)
You are entering your comment into a general purpose hypermedia client for humans, why wouldn't you want a general purpose client for machines?