(
&self,
config: &OAuthConfig,
request: &OAuthRefreshRequest,
)
| 251 | } |
| 252 | |
| 253 | pub async fn refresh_oauth_token( |
| 254 | &self, |
| 255 | config: &OAuthConfig, |
| 256 | request: &OAuthRefreshRequest, |
| 257 | ) -> Result<OAuthTokenSet, ApiError> { |
| 258 | let response = self |
| 259 | .http |
| 260 | .post(&config.token_url) |
| 261 | .header("content-type", "application/x-www-form-urlencoded") |
| 262 | .form(&request.form_params()) |
| 263 | .send() |
| 264 | .await |
| 265 | .map_err(ApiError::from)?; |
| 266 | let response = expect_success(response).await?; |
| 267 | response |
| 268 | .json::<OAuthTokenSet>() |
| 269 | .await |
| 270 | .map_err(ApiError::from) |
| 271 | } |
| 272 | |
| 273 | async fn send_with_retry( |
| 274 | &self, |
no test coverage detected