Name:
interface
Value:
Amplify has re-imagined the way frontend developers build fullstack applications. Develop and deploy without the hassle.

Page updated Apr 29, 2024

Delete data

DELETE requests

RestOptions options = RestOptions.builder()
.addPath("/todo/1")
.build();
Amplify.API.delete(options,
response -> Log.i("MyAmplifyApp", "DELETE succeeded: " + response),
error -> Log.e("MyAmplifyApp", "DELETE failed.", error)
);
val options = RestOptions.builder()
.addPath("/todo/1")
.build()
Amplify.API.delete(options,
{ Log.i("MyAmplifyApp", "DELETE succeeded: $it") },
{ Log.e("MyAmplifyApp", "DELETE failed.", it) }
)
val request = RestOptions.builder()
.addPath("/todo/1")
.build()
try {
val response = Amplify.API.delete(request)
Log.i("MyAmplifyApp", "DELETE succeeded: $response")
} catch (error: ApiException) {
Log.e("MyAmplifyApp", "DELETE failed", error)
}
RestOptions options = RestOptions.builder()
.addPath("/todo/1")
.build();
RxAmplify.API.delete(options)
.subscribe(
response -> Log.i("MyAmplifyApp", "DELETE succeeded: " + response),
error -> Log.e("MyAmplifyApp", "DELETE failed.", error)
);