safeRequest method

Future<OxyResult<Response>> safeRequest(
  1. String method,
  2. String path, {
  3. QueryMap? query,
  4. HeadersInit? headers,
  5. Object? body,
  6. Object? json,
  7. RequestOptions? options,
  8. ProgressCallback? onSendProgress,
  9. ProgressCallback? onReceiveProgress,
})

Implementation

Future<OxyResult<Response>> safeRequest(
  String method,
  String path, {
  QueryMap? query,
  HeadersInit? headers,
  Object? body,
  Object? json,
  RequestOptions? options,
  ProgressCallback? onSendProgress,
  ProgressCallback? onReceiveProgress,
}) {
  return _capture(
    () => request(
      method,
      path,
      query: query,
      headers: headers,
      body: body,
      json: json,
      options: options,
      onSendProgress: onSendProgress,
      onReceiveProgress: onReceiveProgress,
    ),
  );
}