Skip to content

Web APIs

Build native HTTP services with typed handlers, explicit application instances, and generated OpenAPI documentation. Dream keeps routing and dependency resolution in compile-time generators; application configuration belongs to ordinary Dream objects.

Start with your first application, then learn configuration and routers. Continue with parameters and bodies, model validation, and responses.

For application structure, read dependencies, resource cleanup and overrides, lifecycle and state, and middleware and CORS.

Publish interactive documentation with Swagger and OpenAPI. Protect routes with local authentication, external OAuth2/OIDC login, and authorization scopes.

Transport guides cover uploads, streaming and SSE, and WebSockets. Finish with testing, TLS and deployment, and the multifile service example.

Guides in this section

Requirements

HTTP servers require a native Dream target and the dream-host-net capability. Local authentication additionally uses dream-host-crypto. Server calls in WebAssembly programs receive compile-time availability diagnostics. The HTTP client remains available separately through system.net.

Applications mount routers explicitly. Importing a file does not expose its handlers. Two apps may mount the same router with different prefixes and have independent middleware, state, documentation, dependency overrides, and shutdown.