The context spec used to get the Amplify server context.
Input for DELETE operation.
Send a DELETE request
import { del } from 'aws-amplify/api/server';
//...
const restApiResponse = await runWithAmplifyServerContext({
nextServerContext: { request, response },
operation: async (contextSpec) => {
try {
const { headers } = await del(contextSpec, input).response;
} catch (error) {
console.log(error);
return false;
}
},
});
DELETE HTTP request (server-side)