Safe Haskell | None |
---|---|
Language | Haskell2010 |
Provide HTTP primitives
Synopsis
- restLoop :: Auth -> Chan (String, JsonRequest, MVar (Either RestCallException ByteString)) -> Chan String -> IO ()
- class Request a where
- majorRoute :: a -> String
- jsonRequest :: a -> JsonRequest
- data JsonRequest where
- Delete :: Url Https -> Option Https -> JsonRequest
- Get :: Url Https -> Option Https -> JsonRequest
- Patch :: HttpBody a => Url Https -> a -> Option Https -> JsonRequest
- Put :: HttpBody a => Url Https -> a -> Option Https -> JsonRequest
- Post :: HttpBody a => Url Https -> RestIO a -> Option Https -> JsonRequest
- data RestCallException
Documentation
restLoop :: Auth -> Chan (String, JsonRequest, MVar (Either RestCallException ByteString)) -> Chan String -> IO () Source #
class Request a where Source #
majorRoute :: a -> String Source #
jsonRequest :: a -> JsonRequest Source #
Instances
Request (UserRequest a) Source # | |
Defined in Discord.Rest.User majorRoute :: UserRequest a -> String Source # jsonRequest :: UserRequest a -> JsonRequest Source # | |
Request (InviteRequest a) Source # | |
Defined in Discord.Rest.Invite majorRoute :: InviteRequest a -> String Source # jsonRequest :: InviteRequest a -> JsonRequest Source # | |
Request (GuildRequest a) Source # | |
Defined in Discord.Rest.Guild majorRoute :: GuildRequest a -> String Source # jsonRequest :: GuildRequest a -> JsonRequest Source # | |
Request (EmojiRequest a) Source # | |
Defined in Discord.Rest.Emoji majorRoute :: EmojiRequest a -> String Source # jsonRequest :: EmojiRequest a -> JsonRequest Source # | |
Request (ChannelRequest a) Source # | |
Defined in Discord.Rest.Channel majorRoute :: ChannelRequest a -> String Source # jsonRequest :: ChannelRequest a -> JsonRequest Source # |
data JsonRequest where Source #
Represtents a HTTP request made to an API that supplies a Json response
Delete :: Url Https -> Option Https -> JsonRequest | |
Get :: Url Https -> Option Https -> JsonRequest | |
Patch :: HttpBody a => Url Https -> a -> Option Https -> JsonRequest | |
Put :: HttpBody a => Url Https -> a -> Option Https -> JsonRequest | |
Post :: HttpBody a => Url Https -> RestIO a -> Option Https -> JsonRequest |
data RestCallException Source #
RestCallErrorCode Int ByteString ByteString | |
RestCallNoParse String ByteString | |
RestCallHttpException HttpException |
Instances
Show RestCallException Source # | |
Defined in Discord.Rest.HTTP showsPrec :: Int -> RestCallException -> ShowS # show :: RestCallException -> String # showList :: [RestCallException] -> ShowS # |