Copyright | (c) Will Sewell 2016 |
---|---|
License | MIT |
Maintainer | me@willsewell.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
A layer on top of the HTTP functions in the Wreq library which lifts the return values to the typclasses we are using in this library. Non 200 responses are converted into MonadError errors.
Synopsis
- data RequestParams = RequestParams {}
- type RequestQueryString = [(ByteString, ByteString)]
- type RequestBody = Value
- get :: FromJSON a => Manager -> RequestParams -> ExceptT PusherError IO a
- post :: ToJSON a => Manager -> RequestParams -> a -> ExceptT PusherError IO ()
Documentation
data RequestParams Source #
RequestParams | |
|
Instances
Show RequestParams Source # | |
Defined in Network.Pusher.Internal.HTTP showsPrec :: Int -> RequestParams -> ShowS # show :: RequestParams -> String # showList :: [RequestParams] -> ShowS # |
type RequestQueryString = [(ByteString, ByteString)] Source #
type RequestBody = Value Source #
:: FromJSON a | |
=> Manager | |
-> RequestParams | |
-> ExceptT PusherError IO a | The body of the response. |
Issue an HTTP GET request. On a 200 response, the response body is returned. On failure, an error will be thrown into the MonadError instance.
post :: ToJSON a => Manager -> RequestParams -> a -> ExceptT PusherError IO () Source #
Issue an HTTP POST request.