@POST — Aquilia Documentation
Comprehensive guide and documentation for @POST in the Aquilia framework. View API reference, examples, and implementation patterns.
Back to Decorators @POST The @POST decorator handles HTTP POST requests, typically used for creating resources. It provides robust mechanisms for request body validation via Contracts and response formatting. Basic Usage Input Validation & Serialization Aquilia utilizes Contracts to handle request body validation and enforce typed contracts. Response Formatting Control how your data is sent back to the client using response_contract. Key Parameters response_contract: Automatically serializes/molds the return value of the handler using a Contract schema. response_model: Used primarily for OpenAPI documentation to describe the success response schema. status_code: Sets the default HTTP status code (default: 200, typically 201 for POST). API Reference Argument Type Description request_contract Type[Contract] Contract for strictly typed request bodies. response_contract Type[Contract] Contract to mold outgoing response data. status_code int Default HTTP status code (e.g., 201). Previous: @GET Next: @PUT )
Go to Homepage