patch method Null safety

Future<Response> patch(
  1. Object body,
  2. {Map<String, dynamic>? headers}
)

Returns a Response object with the response from the server.

If the request fails, the Response object will have a null Response.body Example:

final response = await "https://example.com/api/v1/users/1".patch(
                   {'name': 'John Doe'},
                  headers: {'content-type': 'application/json'})
                 .patch();

Implementation

Future<Response> patch(Object body, {Map<String, dynamic>? headers}) async {
  return await RequestHandler(this, body: body, headers: headers).patch();
}