Skip to content

HTTP: from routes to responses

Orionis provides a common HTTP API over ASGI and RSGI. The same controller can receive a normalized request, validate input and return JSON, HTML, a file, a stream or SSE. WebSocket connections use a separate connection API within the same routing system.

You need Python 3.14+, the framework’s declared dependencies and a booted application to use facades and container services. Function examples are application code executed when the kernel handles a request. Examples that only construct responses can run without starting a server.

Create an Orionis project first using installation. The paths below are relative to that application, not to the installed framework package. Route declarations run during application boot; handlers run when a request matches a route.

Check the existing app.withRouting(...) call in bootstrap/app.py: it must register the route files you use, commonly web="routes/web.py" and api="routes/api.py". Creating an unregistered route file does not expose its endpoints. Keep existing arguments when adding another file.

  1. Request lifecycle and controllers: services, scopes and asynchronous execution.
  2. Routes, parameters and groups: design an API and organize access.
  3. Input and validation: read metadata and bodies correctly.
  4. Forms and uploads: repeated input and temporary resources.
  5. Responses and cookies: JSON, views, redirects and downloads.
  6. Streaming and SSE: progressive delivery and cleanup.
  7. WebSocket: connections, messages and middleware.
  8. Middleware and security: CSRF, CORS, proxies and limits.
  9. Default pages and routes: health, errors and optional authentication.

Continue with sessions, authentication, schemas, views and Realtime hubs.