doPATCH method

Future doPATCH(
  1. String url,
  2. dynamic body, {
  3. Map<String, String>? headers,
})

Implementation

Future doPATCH(String url, dynamic body, {Map<String, String>? headers}) async {
  headers = _headers(headers);
  url = _url(url);

  var res = await patch(url, jsonEncode(body), headers: headers);

  if (res.statusCode == 401) {
    if (await _refreshToken()) {
      headers = _headers(headers);
      res = await patch(url, jsonEncode(body), headers: headers);
    }
  }

  return _checkResponse(res);
}