Safe Haskell | None |
---|---|
Language | Haskell2010 |
A simple http client to request OAuth2 tokens and several utils.
Synopsis
- fetchAccessToken :: Manager -> OAuth2 -> ExchangeToken -> IO (OAuth2Result Errors OAuth2Token)
- fetchAccessToken2 :: Manager -> OAuth2 -> ExchangeToken -> IO (OAuth2Result Errors OAuth2Token)
- refreshAccessToken :: Manager -> OAuth2 -> RefreshToken -> IO (OAuth2Result Errors OAuth2Token)
- authGetJSON :: FromJSON b => Manager -> AccessToken -> URI -> IO (Either ByteString b)
- authGetBS :: Manager -> AccessToken -> URI -> IO (Either ByteString ByteString)
- authGetBS2 :: Manager -> AccessToken -> URI -> IO (Either ByteString ByteString)
- authPostJSON :: FromJSON b => Manager -> AccessToken -> URI -> PostBody -> IO (Either ByteString b)
- authPostBS :: Manager -> AccessToken -> URI -> PostBody -> IO (Either ByteString ByteString)
- authPostBS2 :: Manager -> AccessToken -> URI -> PostBody -> IO (Either ByteString ByteString)
- authPostBS3 :: Manager -> AccessToken -> URI -> IO (Either ByteString ByteString)
- authRequest :: Request -> (Request -> Request) -> Manager -> IO (Either ByteString ByteString)
Token management
:: Manager | HTTP connection manager |
-> OAuth2 | OAuth Data |
-> ExchangeToken | OAuth 2 Tokens |
-> IO (OAuth2Result Errors OAuth2Token) | Access Token |
Request OAuth2 Token method: POST authenticate in header
:: Manager | HTTP connection manager |
-> OAuth2 | OAuth Data |
-> ExchangeToken | OAuth 2 Tokens |
-> IO (OAuth2Result Errors OAuth2Token) | Access Token |
Request OAuth2 Token method: POST authenticate in both header and body
:: Manager | HTTP connection manager. |
-> OAuth2 | OAuth context |
-> RefreshToken | refresh token gained after authorization |
-> IO (OAuth2Result Errors OAuth2Token) |
Request a new AccessToken with the Refresh Token.
AUTH requests
:: FromJSON b | |
=> Manager | HTTP connection manager. |
-> AccessToken | |
-> URI | |
-> IO (Either ByteString b) | Response as JSON |
Conduct an authorized GET request and return response as JSON.
:: Manager | HTTP connection manager. |
-> AccessToken | |
-> URI | |
-> IO (Either ByteString ByteString) | Response as ByteString |
Conduct an authorized GET request.
:: Manager | HTTP connection manager. |
-> AccessToken | |
-> URI | |
-> IO (Either ByteString ByteString) | Response as ByteString |
same to authGetBS
but set access token to query parameter rather than header
:: FromJSON b | |
=> Manager | HTTP connection manager. |
-> AccessToken | |
-> URI | |
-> PostBody | |
-> IO (Either ByteString b) | Response as JSON |
Conduct POST request and return response as JSON.
:: Manager | HTTP connection manager. |
-> AccessToken | |
-> URI | |
-> PostBody | |
-> IO (Either ByteString ByteString) | Response as ByteString |
Conduct POST request.
:: Manager | HTTP connection manager. |
-> AccessToken | |
-> URI | |
-> PostBody | |
-> IO (Either ByteString ByteString) | Response as ByteString |
Conduct POST request with access token in the request body rather header
:: Manager | HTTP connection manager. |
-> AccessToken | |
-> URI | |
-> IO (Either ByteString ByteString) | Response as ByteString |
Conduct POST request with access token in the header and null in body
:: Request | Request to perform |
-> (Request -> Request) | Modify request before sending |
-> Manager | HTTP connection manager. |
-> IO (Either ByteString ByteString) |
Send an HTTP request including the Authorization header with the specified access token.