Files
responder/docs/source
kennethreitz 2a28353e96 Add HTTP method semantics, handler return values, and app-scoped dependencies
HTTP correctness:
- Wrong method on an existing path returns 405 with an Allow header
  (previously a misleading 404)
- OPTIONS requests are answered automatically with Allow
- HEAD is accepted wherever GET is
- set_cookie() gains a samesite parameter, defaulting to "lax"

Ergonomics:
- Handlers can return values: dict/list -> resp.media, str -> resp.text,
  bytes -> resp.content; returning None keeps mutate-resp behavior
- The validated request_model instance is exposed as req.state.validated
- RouteGroup.before_request hooks are scoped to the group's prefix
  (previously they silently applied globally)

Dependency injection:
- App-scoped dependencies via @api.dependency(scope="app") — resolved
  once on first use, cached for the app's lifetime, generator teardown
  at shutdown; app-scoped providers cannot take parameters
- View signature inspection is cached per function

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 21:41:12 -04:00
..