Spock API reference
These package versions are built together from the Spock repository. Links between them stay within this reference; available dependency documentation links to Hackage.
| Package | Version | Modules |
|---|---|---|
| reroute | 0.9.0.1 | All modules |
| Spock-core | 0.16.1.0 | All modules |
| Spock | 0.18.0.0 | All modules |
| Spock-api | 0.17.0.0 | All modules |
| Spock-api-server | 0.17.0.0 | All modules |
| Spock-session-postgresql | 0.1.0.3 | All modules |
| Spock-session-cookie | 0.1.0.0 | All modules |
| Spock-api-ghcjs | 0.15.0.1 | All modules |
| Spock-browser | 0.1.0.0 | All modules |
Haskell in the browser
Spock-api-ghcjs 0.15.0.1 pairs with Spock-api 0.17.0.0. The client reference is generated from GHC JavaScript 9.12.2 interfaces; the native libraries use GHC 9.14.1. Start with callEndpoint and browserClient, or follow the shared browser/server tutorial.
For typed client-side navigation, see route and mountRouter.
Handling requests and responses
Web.Spock reexports the
Web.Spock.Action module from Spock-core. Start there for request parsing and response helpers.
param: typed query and form parametersparams: all request parametersjsonBody: JSON request bodiesbody: raw request bytesheader: request headersfilesMulti: file uploadssetHeader: response headerstext: plain-text responses
Typed path captures are arguments to your route handler. Set status and headers before sending a response; response helpers finish the action.
Source repository · Generated with Cabal and Haddock.