• PATCH HTTP request (server-side)

    Parameters

    Returns PatchOperation

    Throws

    • RestApiError

    Example

    Send a PATCH request

    import { patch } from 'aws-amplify/api/server';
    //...
    const restApiResponse = await runWithAmplifyServerContext({
    nextServerContext: { request, response },
    operation: async (contextSpec) => {
    try {
    const { body } = await patch(contextSpec, input).response;
    return await body.json();
    } catch (error) {
    console.log(error);
    return false;
    }
    },
    });