Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Html IO-based servers
Synopsis
- type Get a = Send GET IO (Resp a)
- type Post a = Send POST IO (Resp a)
- type Put a = Send PUT IO (Resp a)
- type Delete a = Send DELETE IO (Resp a)
- type Patch a = Send PATCH IO (Resp a)
- type Options a = Send OPTIONS IO (Resp a)
- type Head a = Send HEAD IO (Resp a)
- type Trace a = Send TRACE IO (Resp a)
- newtype Resp a = Resp (Resp Html a)
- type RespOr err a = Either (Resp err) (Resp a)
- newtype Body (media :: k) a = Body a
- module Mig.Extra.Server.Common
Http verbs
Response
Instances
ToMarkup a => IsResp (Resp a) Source # | |
Defined in Mig.Extra.Server.Html ok :: RespBody (Resp a) -> Resp a # bad :: Status -> RespError (Resp a) -> Resp a # noContent :: Status -> Resp a # addHeaders :: ResponseHeaders -> Resp a -> Resp a # getHeaders :: Resp a -> ResponseHeaders # setStatus :: Status -> Resp a -> Resp a # getRespBody :: Resp a -> Maybe (RespBody (Resp a)) # getRespError :: Resp a -> Maybe (RespError (Resp a)) # getStatus :: Resp a -> Status # setMedia :: MediaType -> Resp a -> Resp a # toResponse :: Resp a -> Response # | |
type RespBody (Resp a) Source # | |
type RespError (Resp a) Source # | |
type RespMedia (Resp a) Source # | |
re-exports
Generic case for request body. The type encodes a media type and value of the request body.
Body a |
Instances
(FromReqBody ty a, ToSchema a, ToPlugin b) => ToPlugin (Body ty a -> b) | |
Defined in Mig.Core.Class.Plugin | |
(ToSchema a, FromReqBody media a, ToRoute b) => ToRoute (Body media a -> b) | |
Defined in Mig.Core.Class.Route toRouteInfo :: RouteInfo -> RouteInfo # toRouteFun :: (Body media a -> b) -> ServerFun (MonadOf (Body media a -> b)) # | |
FromClient b => FromClient (Body media a -> b) | |
Defined in Mig.Client type ClientResult (Body media a -> b) # fromClient :: (Body media a -> b) -> ClientResult (Body media a -> b) # | |
(ToRespBody media a, ToClient b) => ToClient (Body media a -> b) | |
Defined in Mig.Client | |
type ClientResult (Body media a -> b) | |
Defined in Mig.Client |
module Mig.Extra.Server.Common