By the end of this lesson, you will be able to:
- Describe what REST is and why it is important
- List the 5 HTTP verbs used in RESTful development
- Describe the HTTP methods supported by the browser
- List the CRUD RESTful routes
- Discuss CRUDL and relate it to REST concepts
- Explain how to do a PUT request in Express
- Contrast Idempotent and Safe
5
REST is an architectural style of APIs, where the focus is on a specific set of interactions between the client and server, rather than implementation details.
Its purpose is to induce performance, scalability, simplicity, modifiability, visibility, portability, and reliability.
3
GET
POST
PUT
PATCH
DELETE
HTML Forms: 'method'
- Post
- Get
JavaScript:
- All
How do we do a put/patch/delete?
NPM Method-Override
https://www.npmjs.com/package/method-override
3
LIST
app.get('/')
READ
app.get('/:id')
CREATE
app.post('/')
UPDATE
app.patch('/:id')
app.put('/:id')
DELETE
app.delete('/:id')
LIST
app.get('/') : 200
READ
app.get('/:id') : 200
CREATE
app.post('/') : 201
UPDATE
app.patch('/:id') : 200
app.put('/:id') : 200
DELETE
app.delete('/:id') : 204
Idempotent - A HTTP method that can be called many times without different outcomes.
Safe - A HTTP methods that do not modify resources
By the end of this lesson, you will be able to:
- Describe what REST is and why it is important
- List the 5 HTTP verbs used in RESTful development
- Describe the HTTP methods supported by the browser
- Discuss CRUDL and relate it to REST concept
- List the CRUD RESTful routes
- Explain how to do a PUT request in Express
- Contrast Idempotent and Safe