loginOAuthAccessToken method
Implementation
Future<LoginOauthIdTokenResponse> loginOAuthAccessToken(LoginOauthAccessTokenRequest params) async {
final url = Uri.parse('${_wepinBaseUrl}user/oauth/login/access-token');
final jsonRequestBody = jsonEncode(params.toJson());
final response = await http.post(
url,
headers: headers,
body: jsonRequestBody,
);
if (response.statusCode >= 200 && response.statusCode < 300) {
final responseBody = jsonDecode(response.body);
return LoginOauthIdTokenResponse.fromJson(responseBody);
} else {
throw WepinError(WepinErrorCode.apiRequestError, 'code: ${response.statusCode} , body: ${response.body}');
}
}