-
Notifications
You must be signed in to change notification settings - Fork 73
HTTP Methods
Thomas Pollet edited this page Mar 8, 2026
·
4 revisions
- Applies to: Flask and FastAPI
- Best examples:
examples/mini_examples/ex15_http_hook.py,examples/demo_http_method.py - Related pages: Endpoint Decorators, Customization, Quickstart (FastAPI)
You can restrict the CRUD methods SAFRS exposes with http_methods.
Examples:
http_methods = {"GET", "POST"}In the FastAPI adapter, http_methods affects both runtime behavior and generated OpenAPI operations.
Common hook points include:
_s_post_s_patch
Example:
You can create read-only or partially writable models by restricting http_methods rather than overriding every individual operation.
Relationship mutation behavior also depends on whether the parent model remains patchable. This is especially visible in the FastAPI adapter.
The FastAPI adapter explicitly reads Model.http_methods, documents the allowed operations, and gates routes accordingly.
- Home
- Installation
- Quickstart (Flask)
- Quickstart (FastAPI)
- JSON:API Basics
- Relationships and Includes
- Filtering
- Sorting, Pagination, and Sparse Fieldsets
- Content Types and Errors
- Bulk Requests
- RPC / Custom Methods
- Customization
- Security and Access Control
- Stateless Endpoints / JABase
- Performance
- Examples
- Existing Databases (Legacy)
- PostGIS / GeoAlchemy2
- Docker / Deployment
- Troubleshooting
- Reference: SAFRSBase
- Reference: SAFRSBase Customization