Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data HttpRequest m = HttpRequest {
- _headers_Rq :: Headers
- _body_Rq :: Source m ByteString
- headers_Rq :: forall m. Lens' (HttpRequest m) Headers
- body_Rq :: forall m m. Lens (HttpRequest m) (HttpRequest m) (Source m ByteString) (Source m ByteString)
- data HttpResponse m = HttpResponse {
- _headers_Rp :: Headers
- _body_Rp :: Source m ByteString
- headers_Rp :: forall m. Lens' (HttpResponse m) Headers
- body_Rp :: forall m m. Lens (HttpResponse m) (HttpResponse m) (Source m ByteString) (Source m ByteString)
- class Monad m => Http1CycleController m contrl where
- releaseResponseResources :: contrl -> m ()
- class (Http1CycleController m contrl, Monad m) => ProxyToHttpServer m conn contrl | conn -> contrl m where
- proxyToConnection :: conn -> HttpRequest m -> m (HttpResponse m, contrl)
Documentation
data HttpRequest m
Request. This is an old-fashioned HTTP request, with less data than that defined at CoherentWorker: just headers and perhaps a request streaming body. As in other places in this library, we expect method and path to be given as pseudo-headers
headers_Rq :: forall m. Lens' (HttpRequest m) Headers
body_Rq :: forall m m. Lens (HttpRequest m) (HttpRequest m) (Source m ByteString) (Source m ByteString)
data HttpResponse m
Response. Status should be given as a pseudo-header
headers_Rp :: forall m. Lens' (HttpResponse m) Headers
body_Rp :: forall m m. Lens (HttpResponse m) (HttpResponse m) (Source m ByteString) (Source m ByteString)
class Monad m => Http1CycleController m contrl where
releaseResponseResources :: contrl -> m ()
class (Http1CycleController m contrl, Monad m) => ProxyToHttpServer m conn contrl | conn -> contrl m where
Something that can talk to a HTTP 1.1 server by using a connection and sending the request to it
proxyToConnection :: conn -> HttpRequest m -> m (HttpResponse m, contrl)