@OPTIONS — Aquilia Documentation
Comprehensive guide and documentation for @OPTIONS in the Aquilia framework. View API reference, examples, and implementation patterns.
Back to Decorators @OPTIONS The @OPTIONS decorator handles HTTP OPTIONS requests, primarily used for Cross-Origin Resource Sharing (CORS) preflight checks and discovering allowed methods on a resource. Implicit vs Explicit Automatic Handling Aquilia's router automatically handles OPTIONS requests for CORS preflight if you have the CORS Middleware enabled. You rarely need to define @OPTIONS handlers manually. Manual Definition If you need custom logic for an OPTIONS request (e.g., dynamic capability advertising), you can define it explicitly. CORS Preflight Browsers send an OPTIONS request before making complex cross-origin requests (e.g., checks for headers like Authorization or Content-Type: application/json). The manual handler allows you to inspect Access-Control-Request-Method and Access-Control-Request-Headers to implement fine-grained security policies beyond global middleware settings. Previous: @HEAD Next: @WS )
Go to Homepage