https://github.com/mfurquimdev/fastapi_params
https://github.com/mfurquimdev/fastapi_params
Last synced: 26 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/mfurquimdev/fastapi_params
- Owner: mfurquimdev
- Created: 2024-03-12T14:14:03.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-03-12T22:22:38.000Z (over 2 years ago)
- Last Synced: 2025-03-03T01:18:19.789Z (over 1 year ago)
- Language: Python
- Size: 10.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FastAPI_params
## Starting server
```bash
$ pdm run python src/main.py
```
## Making requests
```bash
$ http GET :8000/params/test_1 number==3 period:='{"start": "2023-01-01", "end": "2023-01-02"}'
{
"test_1": {
"end": "2023-01-02T00:00:00",
"start": "2023-01-01T00:00:00"
}
}
```
Sleep for 3 seconds and print on server side:
```txt
GET on /params endpoint with Path parameter name=test_1, Query parameter sleep=number=3 micro=False, and Body parameter period=2023-01-01 00:00:00 - 2023-01-02 00:00:00
```
### Optional micro Query parameter
```bash
$ http GET :8000/params/test_1 micro==True number==3 period:='{"start": "2023-01-01", "end": "2023-01-02"}'
```
Sleep for 0.3 seconds and print on server side:
```txt
GET on /params endpoint with Path parameter name=test_1, Query parameter sleep=number=3 micro=True, and Body parameter period=2023-01-01 00:00:00 - 2023-01-02 00:00:00
```