Rest API

REST API

Rest stands for Representational State Transfer

6 constrains

  1. Uniform interface
    • resources based instead of action based
    • URI, resources(JSON or XML), http header
  2. Stateless
    • every client request is consistent
    • no need to maintain sessions
  3. Cacheable
    • client maintain cache
  4. Client-Server
    • uniform interface separates client and server
  5. Layered System
    • Client cannot tell whether is connected directly to the server or through intermediates
  6. (Optional) code on demand

HTTP actions:
GET (obtain)
PUT (update/replace)
PATCH (update/modify)
DELETE (remove)
POST (upload)

HTTP RESPONSE Codes

200 OK
201 Created
204 No Content
400 Bad Request
401 unauthorised
403 forbidden
404 not found
405 method not allowed
409 conflict
500 internal server error

CRUD – Create, read, update and delete

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published.