Other commenters are correct that POST /accounts/4402278/close is not right (and also fairly hilariously contradicted in the next section). Account status (open, closed, suspended, whatever else) is a property of the account, in the same way that the account owner's name is a property of the account. If you went to all the trouble to represent each account as its own resource, which I assume responds correctly otherw…
This depends on your data model. If "status" is just a property on the accounts resource and doesn't have further meaning, I would tend to agree with you. If "close" is an action or activity that acts upon an accounts resource, then his approach makes sense. Since the context is an account that we "need to close," I would assume the author is talking about something more complex than a database field. It's probably a…
REST Anti-patterns
131–133 of 133 posts
[deleted]
Re: REST Anti-patterns
#132The content of the blog post is okay, but the premise is flawed. Most of us have reluctantly accepted the abuse of terminology that happens when everyone calls these APIs 'RESTful' -- but they're not. They're inspired by REST, but cargo-cult took the easiest-to-implement pieces all the while pretending to stand on some moral high-ground about not being openly RPC because 'RESTful is the right way'. This results in a…
HATEOAS is critical to REST -- it being nothing more than a terribly obtuse rendition of the ideas behind how the web
REST APIs must be hypertext-driven. http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hyperte...
Re: REST Anti-patterns
#133Earlier quoted context omitted.
Only when it's GET request. This request will not return you any resource information, with id if account or without.
In your mind, what does URL stand for? It's an acronym.
Do you really expect to get resource data when you send POST or DELETE request? If yes, then web (and REST) is not as perfect as you expect.