Most RESTful APIs aren't really RESTful
florian-kraemer.net
Most RESTful APIs aren't really RESTful
1–10 of 580 posts
Re: Most RESTful APIs aren't really RESTful
#2> The widespread adoption of a simpler, RPC-like style over HTTP can probably attributed to practical trade-offs in tooling and developer experience
> Therefore, simply be pragmatic. I personally like to avoid the term “RESTful” for the reasons given in the article and instead say “HTTP” based APIs.
Re: Most RESTful APIs aren't really RESTful
#3 /draw_point?x=7&y=20&r=255&g=0&b=0
/get_point?x=7&y=20
/delete_point?x=7&y=20
Because that is the easiest to implement, the easiest to write, the easiest to manually test and tinker with (by writing it directly into the url bar), the easiest to automate (curl .../draw_point?x=7&y=20). It also makes it possible to put it into a link and into a bookmark.This is also how HN does it:
/vote?id=44507373&how=up&auth=...Re: Most RESTful APIs aren't really RESTful
#4Re: Most RESTful APIs aren't really RESTful
#5A client application that doesn't have any knowledge about what actions are going to be possible with a resource, instead rendering them dynamically based on the API responses, is going to make them all look the same.
So RESTful APIs as described in the article aren't useful for the most common use case of Web APIs, implementing frontend UIs.
Re: Most RESTful APIs aren't really RESTful
#6You know what type of API I like best? /draw_point?x=7&y=20&r=255&g=0&b=0 /get_point?x=7&y=20 /delete_point?x=7&y=20 Because that is the easiest to implement, the easiest to write, the easiest to manually test and tinker with (by writing it directly into the url bar), the easiest to automate (curl .../draw_point?x=7&y=20). It also makes it possible to put it into a link and into a bookmark. This is also how HN does i…
REST-API's then are especially suited for acting as a gateway to a database, to easily CRUD and fetch lists of information.
The best API's I've seen mix and match both patterns. RESTful API endpoints for data, "function call" endpoints for often-used actions like voting, bulk actions and other things that the client needs to be able to do, but you want the API to be in control of how it is applied.
Re: Most RESTful APIs aren't really RESTful
#7You know what type of API I like best? /draw_point?x=7&y=20&r=255&g=0&b=0 /get_point?x=7&y=20 /delete_point?x=7&y=20 Because that is the easiest to implement, the easiest to write, the easiest to manually test and tinker with (by writing it directly into the url bar), the easiest to automate (curl .../draw_point?x=7&y=20). It also makes it possible to put it into a link and into a bookmark. This is also how HN does i…
Surely you're not advocating mutating data with GET?
Re: Most RESTful APIs aren't really RESTful
#8It’s interesting that Stripe still even uses form-post on requests.
Re: Most RESTful APIs aren't really RESTful
#9Re: Most RESTful APIs aren't really RESTful
#10Also, who determined these rules are the definition of RESTful?