patch<T> method

Future<Response<T>> patch<T>(
  1. String url, {
  2. dynamic body,
  3. String? contentType,
  4. Map<String, String>? headers,
  5. Map<String, dynamic>? query,
  6. Decoder<T>? decoder,
  7. Progress? uploadProgress,
})

Implementation

Future<Response<T>> patch<T>(
  String url, {
  dynamic body,
  String? contentType,
  Map<String, String>? headers,
  Map<String, dynamic>? query,
  Decoder<T>? decoder,
  Progress? uploadProgress,
  // List<MultipartFile> files,
}) async {
  try {
    var response = await _performRequest<T>(
      () => _request<T>(
        url,
        'patch',
        contentType: contentType,
        body: body,
        query: query,
        decoder: decoder,
        uploadProgress: uploadProgress,
      ),
      headers: headers,
    );
    return response;
  } on Exception catch (e) {
    if (!errorSafety) {
      throw GetHttpException(e.toString());
    }
    return Future.value(Response<T>(
      statusText: 'Can not connect to server. Reason: $e',
    ));
  }
}