Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Utility and base types and functions for the Discord Rest API
Synopsis
- apiVersion :: Text
- baseUrl :: Url 'Https
- authHeader :: Auth -> Option 'Https
- (/?) :: ToHttpApiData a => Url scheme -> Maybe a -> Url scheme
- data JsonRequest where
- Delete :: Url 'Https -> Option 'Https -> JsonRequest
- Get :: Url 'Https -> Option 'Https -> JsonRequest
- Put :: HttpBody a => Url 'Https -> a -> Option 'Https -> JsonRequest
- Patch :: HttpBody a => Url 'Https -> RestIO a -> Option 'Https -> JsonRequest
- Post :: HttpBody a => Url 'Https -> RestIO a -> Option 'Https -> JsonRequest
- class Request a where
- majorRoute :: a -> String
- jsonRequest :: a -> JsonRequest
- newtype RestIO a = RestIO {
- restIOtoIO :: IO a
Documentation
apiVersion :: Text Source #
The api version to use.
data JsonRequest where Source #
A compiled HTTP request ready to execute
Delete :: Url 'Https -> Option 'Https -> JsonRequest | |
Get :: Url 'Https -> Option 'Https -> JsonRequest | |
Put :: HttpBody a => Url 'Https -> a -> Option 'Https -> JsonRequest | |
Patch :: HttpBody a => Url 'Https -> RestIO a -> Option 'Https -> JsonRequest | |
Post :: HttpBody a => Url 'Https -> RestIO a -> Option 'Https -> JsonRequest |
class Request a where Source #
majorRoute :: a -> String Source #
used for putting a request into a rate limit bucket https://discord.com/developers/docs/topics/rate-limits#rate-limits
jsonRequest :: a -> JsonRequest Source #
build a JSON http request