Module
Erl.Cowboy.Req
- Package
- erl-cowboy
- Repository
- purerl/purescript-erl-cowboy
Bindings for cowboy_req
The Req type (corresponding to req()) is core to the use of cowboy, containing information about request and response.
Many functions operating on Req are pure, producing an updated Req if required to update some fields, e.g. when setting a
header, but others produce a result in Effect as even though they may update the Req, they also cause side-effects such as
sending traffic on the network (eg reply).
#replyWithoutBody Source
replyWithoutBody :: StatusCode -> Headers -> Req -> Effect ReqSend the reply without setting the body (cowboy_req:reply/3)
#replyWithFile Source
replyWithFile :: StatusCode -> Headers -> String -> Req -> Effect ReqSend the reply including a file as the body
#replyStatus Source
replyStatus :: StatusCode -> Req -> Effect ReqSend the reply with already set headers and body (cowboy_req:reply/2)
#bindingWithDefault Source
bindingWithDefault :: forall a. Atom -> Req -> a -> a#setCookieWithOpts Source
setCookieWithOpts :: String -> String -> CookieOpts -> Req -> Req#streamReply Source
streamReply :: StatusCode -> Headers -> Req -> Effect Req#setIdleTimeout Source
setIdleTimeout :: IntOrInfinity -> Req -> Effect Unit