Basic Python/FastAPI
FastAPI-GET and POST
Naranjito
2022. 7. 21. 14:35
- How HTTP works
1. Request('what', 'how') : Client(Browser) → Server
↑Through HTTP Request Message
2. Response : Server → Client(Browser)
↑Contains request information
- Message has Method(which means 'how')
HEADER |
BODY |
- GET VS POST
GET | POST | |
Whether data is exposed on URL | Yes | No |
URL Example | http://localhost:8080/items/?item_id=123&q=100 | http://localhost:8080/items |
Data Location | Header | Body |
Caching Availability | Yes | No |
- GET
- Can be cached
- Remains in the browser history
- Has length restriction
- Only used to request data (not modify)
- POST
- Never be cached
- Not remain in the browser history
- Has no length restriction
Reference