Page updated Jan 16, 2024

Update data

Amplify Flutter v0 is now in Maintenance Mode until July 19th, 2024. This means that we will continue to include updates to ensure compatibility with backend services and security. No new features will be introduced in v0.

Please use the latest version (v1) of Amplify Flutter to get started.

If you are currently using v0, follow these instructions to upgrade to v1.

PUT requests

To update an item via the API endpoint:

1Future<void> updateTodo() async {
2 try {
3 final options = RestOptions(
4 path: '/todo/1',
5 body: Uint8List.fromList('{\'name\':\'Mow the lawn\'}'.codeUnits),
6 );
7 final restOperation = Amplify.API.put(restOptions: options);
8 final response = await restOperation.response;
9 print('PUT call succeeded');
10 print(response.body);
11 } on ApiException catch (e) {
12 print('PUT call failed: $e');
13 }
14}