Native HTTP QUERY method support for FastAPI with automatic cache control and Swagger compatibility.
Project description
FastAPI Extended Query Method
Native HTTP QUERY support for FastAPI.
Overview
FastAPIWithQueryHttpMethod extends FastAPI with native support for the
HTTP QUERY method while preserving the FastAPI developer experience.
Installation
pip install fastapi-extended-query-method
Quick Start
from src.fastapi_extended_query_method import FastAPIWithQueryHttpMethod
app = FastAPIWithQueryHttpMethod(query_saving_cache=True)
Swagger compatibility
After starting the application:
http://localhost:8000/docs
OpenAPI and Swagger do not currently support the HTTP QUERY method.
For that reason this package automatically exposes QUERY endpoints as both:
- QUERY
- POST
Use the POST operation in Swagger only for interactive testing.
Real clients should invoke the QUERY method directly.
Cache
query_saving_cache=True allows caching.
query_saving_cache=False automatically adds:
- Cache-Control: no-store
- Pragma: no-cache
- Expires: 0
Testing API
python validate_data/test_api_query_method.py
Testing Cache
Using Cache Stored
python validate_data/test_cache_comparison.py
NO Using Cache Stored
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastapi_extended_query_method-0.0.31.tar.gz.
File metadata
- Download URL: fastapi_extended_query_method-0.0.31.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fde4160143d3a66785645f6caf8a3594923d73731114b773f55a172fcaa7cfe
|
|
| MD5 |
1f957f8ee0cfc28cc18aaa7fe13ce5f0
|
|
| BLAKE2b-256 |
f10e3d5f30821dc7667a45dd5d4b6718533182601c2f2897d3f7099f38851c36
|
File details
Details for the file fastapi_extended_query_method-0.0.31-py3-none-any.whl.
File metadata
- Download URL: fastapi_extended_query_method-0.0.31-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17995753f0c772b8e7d3077276b5809df18eea6b937be0e6ed84a90d99fcbf5b
|
|
| MD5 |
6c471e02f6bd567234f70d808be285a2
|
|
| BLAKE2b-256 |
9667dff4e3bc24836a2ce9ebd279ebb8480d7da4bc4ecb374d7030db8bb07d0d
|