REST API Design and Basics Flashcards
REST
REpresentational State Transfer
- REST does not enforce any implementation
- High-level design guidelines
- Client-server designed pattern
- Stateless
- Requests made through simple HTTP
HTTP
Hyper Test Transfer Protocol - application layer protocol for transmitting hypermedia
REST APIs
An API is an application programming interface. Set of rules that allow programs to talk to each other.
HTTP Methods
GET, POST, PUT, DELETE
GET
Retrieve a resource
POST
Create a new resource
PUT
Update an existing resource
DELETE
Delete an existing resource
Proper HTTP Status Codes
Return appropriate HTTP status codes to indicate the success or failure of a request
- 200 OK for GET
- 201 Created for POST
- 204 No content for DELETE
- 400 Bad request for client errors
- 404 Not found
- 500 Internal server error
RESTful URLS
Use meaningful and hierarchical URLs