Safe Haskell | None |
---|---|
Language | Haskell2010 |
Conversion between Network.URI and routable representations such as Request
.
The most useful function here is routeActionURI
which performs reverse routing.
If you have an action already defined:
getThing :: 'RouteAction' Int (IO Response)
Then routeActionURI getThing 123
will return the method and URI for that route, filling in the placeholders appropriately, e.g., (GET, "/thing/123")
.
Synopsis
- requestURI :: Request -> URI
- uriRequest :: IsMethod m => m -> URI -> Request
- uriGETRequest :: URI -> Request
- routeActionURI :: RouteAction r a -> r -> (Method, URI)
Documentation
requestURI :: Request -> URI Source #
Convert a request to a URI, ignoring the method.
uriGETRequest :: URI -> Request Source #
Convert a GET URI to a request.
routeActionURI :: RouteAction r a -> r -> (Method, URI) Source #
Reverse a route action to a URI.