DEV Community


Rate my understanding of REST

yujiri8 profile image Ryan Westlund ・1 min read

I'm gonna describe what I think RESTful architecture means, and you tell me if I'm accurate.

Every resource - every domain object - is mapped to a URL. A customer with ID 6 might be /customers/6, and a client can get the customer as a JSON object by sending a GET request to that URL. An order linked to the customer could be at /orders/52.

Mutating of data generally happens on the client, and multiple HTTP verbs are used: POST /customers to create a resource (which should return a response revealing the ID of the new custoemr), PUT /customers/6 to update (which is idempotent), DELETE /customers/6 to delete, etc.

Discussion (5)

Editor guide
patarapolw profile image
Pacharapol Withayasakpunt • Edited

I would use PATCH to partial update.

GET and DELETE should not have request body. It becomes a problem when you want GET or DELETE body bigger than URL encoded length limit.

About higher level of REST, there is also hypermedia.

blessingartcreator profile image
Blessing Hirwa

Totally agree

ecyrbe profile image

I rate you at 2 out 5.
you can read more about REST maturity here

yujiri8 profile image
misobelica profile image

I think this video could be interesting for you 🙂 the thing is the URL is not very important when it comes to REST.