post method

  1. @override
Future<Response> post(
  1. Uri uri, {
  2. Map<String, String>? headers,
  3. dynamic body,
  4. Encoding? encoding,
  5. Duration? timeout,
})
override

Implementation

@override
Future<Response> post(
  Uri uri, {
  Map<String, String>? headers,
  dynamic body,
  Encoding? encoding,
  Duration? timeout,
}) {
  return oauthClient
      .post(uri, headers: headers, body: body, encoding: encoding)
      .timeout(timeout ?? defaultTimeout)
      .then((response) {
    if (response.statusCode >= 200 && response.statusCode < 300) {
      return response;
    } else {
      return Future.error(response);
    }
  });
}