get method

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

Sends an HTTP GET request to the REST API endpoint.

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

Example:

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

Implementation

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