Safe Haskell | None |
---|---|
Language | Haskell98 |
This module bridges the minimal calls in the Client module, adds specific headers required by the API, and passes them to the more generic calls of the OAuth2 module.
It also includes auxiliary funtions for handling
its main return type: ResponseData
.
- pokitdokGetRequest :: OAuth2 -> String -> Parameters -> IO ResponseData
- pokitdokDeleteRequest :: OAuth2 -> String -> IO ResponseData
- pokitdokPostRequest :: OAuth2 -> String -> String -> IO ResponseData
- pokitdokPutRequest :: OAuth2 -> String -> String -> IO ResponseData
- pokitdokMultipartRequest :: OAuth2 -> String -> Parameters -> String -> IO ResponseData
- activateKeyWithAuthCode :: OAuth2 -> String -> IO OAuth2
- refreshExpired :: OAuth2 -> Bool -> IO OAuth2
- isExpired' :: AccessToken -> IO Bool
- assertValid :: OAuth2 -> IO ()
- getJSONIO :: ResponseData -> IO String
Documentation
:: OAuth2 | An OAuth2 credential. |
-> String | The request url path. |
-> Parameters | The query parameters. |
-> IO ResponseData | The response from the server. |
Sends a GET request to the server with the given query parameters.
:: OAuth2 | A credential. |
-> String | The request url path. |
-> IO ResponseData | Response from the server. |
Sends a DELETE request to the server with the given query parameters.
:: OAuth2 | Credentials. |
-> String | The request url path. |
-> String | JSON object String. |
-> IO ResponseData | Response from the server. |
Sends a POST request to the server and posts the json string.
:: OAuth2 | Credentials. |
-> String | The request url path. |
-> String | A JSON object String. |
-> IO ResponseData | Response from the server. |
Sends a PUT request with JSON data.
pokitdokMultipartRequest Source
:: OAuth2 | Credentials. |
-> String | The request url path. |
-> Parameters | Post data. |
-> String | File system path of file to be posted. |
-> IO ResponseData | Response from the server. |
A multipart request that uploads a file.
activateKeyWithAuthCode :: OAuth2 -> String -> IO OAuth2 Source
Takes an OAuth2
& an authorization code,
and returns an OAuth2
with a refreshed AccessToken
.
refreshExpired :: OAuth2 -> Bool -> IO OAuth2 Source
Refreshes an OAuth2
's token given whether or not it is expired.
isExpired' :: AccessToken -> IO Bool Source
Checks if the given AccessToken
is expired.
assertValid :: OAuth2 -> IO () Source
Asserts that the given OAuth2
is valid to make a call.
getJSONIO :: ResponseData -> IO String Source
Pulls the JSON response String
from a ResponseDat
um,
and lifts the result to an IO monad.