patchx<T> method

Future<Response> patchx<T>(
  1. String path, {
  2. Options? queryParams,
  3. Object? body,
})

Implementation

Future<Response> patchx<T>(String path,
    {Options? queryParams, Object? body}) async {
  try {
    Map<String, String> headers =
        CommonHelper().getHearder(headerParams, baseOptions, queryParams);
    headers = Map.from(headers)..addAll(headerDefault);
    var response = await patch(Uri.parse(path), headers: headers, body: body);
    if (response.reasonPhrase != 'OK') throw response.body;
    return Future.value(response);
  } on FormatException catch (_) {
    throw const FormatException("Unable to process the data");
  } catch (e) {
    throw e.toString();
  }
}