head method

RestOperation head(
  1. String path, {
  2. Map<String, String>? headers,
  3. Map<String, String>? queryParameters,
  4. String? apiName,
})

Sends an HTTP HEAD request to the REST API endpoint.

Example:

final restOperation = Amplify.API.head('items');
final response = await restOperation.response;
print(response.decodeBody()); // 'Hello from lambda!'

Implementation

RestOperation head(
  String path, {
  Map<String, String>? headers,
  Map<String, String>? queryParameters,
  String? apiName,
}) =>
    identifyCall(
      ApiCategoryMethod.head,
      () => defaultPlugin.head(
        path,
        headers: headers,
        apiName: apiName,
        queryParameters: queryParameters,
      ),
    );