Input for PATCH operation
Operation for PATCH request
Send a PATCH request
import { patch } from '@aws-amplify/api';
const { body } = await patch({
apiName,
path,
options: {
headers, // Optional, A map of custom header key/values
body, // Optional, JSON object or FormData
queryParams, // Optional, A map of query strings
}
}).response;
const data = await body.json();
Cancel a PATCH request
import { patch, isCancelError } from '@aws-amplify/api';
const { response, cancel } = patch({apiName, path, options});
cancel(message);
try {
await response;
} catch (e) {
if (isCancelError(e)) {
// handle request cancellation
}
//...
}
PATCH HTTP request