• HEAD HTTP request (server-side)

    Parameters

    Returns HeadOperation

    Throws

    • RestApiError

    Example

    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;
    }
    },
    });