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