post method

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

Sends an HTTP POST request to the REST API endpoint.

See https://docs.amplify.aws/lib/restapi/update/q/platform/flutter/ for more information.

Example:

final restOperation = Amplify.API.post(
  'items',
  body: HttpPayload.json({'name': 'Mow the lawn'}),
);
final response = await restOperation.response;
print(response.decodeBody()); // 'Hello from lambda!'

Implementation

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