redditwarp.core.reddit_token_obtainment_client_SYNC
#
- class redditwarp.core.reddit_token_obtainment_client_SYNC.RedditTokenObtainmentClient(http: HTTPClient, url: str, client_creds: ClientCredentials, grant: AuthorizationGrant)[source]#
Bases:
TokenObtainmentClient
- fetch_data() Mapping[str, Any] [source]#
Exchange an authorisation grant for OAuth2 token data.
Makes a POST request to the specified URL (
url
) with the provided client credentials (client_creds
) and authorization grant (grant
).- Returns:
A dictionary of OAuth2 token data.
- Return type:
Mapping[str, Any]
- Raises:
redditwarp.http.exceptions.StatusCodeException – The response from the server is not a success status code.
ValueError – The response from the server cannot be parsed as JSON.