doPatchRequest method

Future<Response> doPatchRequest(
  1. Uri uri,
  2. Map<String, dynamic> body,
  3. User? user, {
  4. QueryType? queryType,
})

Send a http PATCH request to the specified uri.

The data / body of the request has to be provided as map. (key, value) The result of the request will be returned as string.

Implementation

Future<http.Response> doPatchRequest(
  final Uri uri,
  final Map<String, dynamic> body,
  final User? user, {
  final QueryType? queryType,
}) async =>
    http.patch(
      uri,
      headers: _buildHeaders(
        user: user,
        isTestModeActive: OpenFoodAPIConfiguration.getQueryType(queryType) !=
            QueryType.PROD,
        addCredentialsToHeader: false,
      ),
      body: jsonEncode(addUserAgentParameters(body)),
    );