HTTP
Created: September 06, 2020
Methods
GET
- Retrieve a resource.
200 (OK)responses are cached, among several others.
PUT
- Replace current representations of a resource.
- Should create resources that do not otherwise exist.
- Much like a SQL UPDATE.
- Idempotent. Doing the same PUT lots of times should have the same result.
- Not cached.
POST
- Submit a new subordinate resource.
- Much like a SQL CREATE.
- Not idempotent. Doing it multiple times will cause multiple resources to be created.
- Possibly cached with configuration.
DELETE
- Delete a resource.
Less Common Methods
- HEAD: like a GET but only metadata is returned.
- CONNECT: establish a connection to the specified resource.
- OPTIONS: communication options.
- TRACE: loop-back test.
- PATCH: patch a resource.
Response Codes
| Code | Description |
|---|---|
| 100 | Continue; partial request received |
| 101 | OK to switch protocols |
| 200 | OK; all requested info returned |
| 201 | Created; request filled |
| 202 | Accepted; request received |
| 203 | Source unknown; 3rd party info |
| 204 | No new content; nothing to send |
| 205 | Reset content; OK to clear form |
| 206 | Request only partially filled |
| 300 | Header for 3xx codes |
| 301 | Moved permanently; use new URL |
| 302 | Moved temporarily; use same URL |
| 303 | Redirected |
| 304 | Not modified; use cached copy |
| 305 | Use proxy; URL is provided |
| 400 | Did not understand request |
| 401 | Password required |
| 402 | Payment required |
| 403 | Request refused |
| 404 | Not found |
| 406 | Content type not acceptable |
| 407 | Browser must authenticate |
| 408 | Timed out; send again |
| 409 | Update conflict with explanation |
| 410 | Not found; resource gone |
| 411 | Content length missing |
| 412 | Conditions on request failed |
| 413 | Request too long to process |
| 414 | Resource address too long |
| 415 | Unsupported media type; bad format |
| 500 | Internal error |
| 501 | Cannot fill request |
| 502 | Cannot process gateway request |
| 503 | Overloaded or service over limits |
| 504 | Gateway or proxy server timed out |
| 505 | HTTP version not supported |
- Source: thefreedictionary.com