rest-vir - v1.2.6
    Preparing search index...

    Variable formDataShapeConst

    formDataShape: (defaultValue?: FormData) => Shape<TUnsafe<FormData>> = ...

    A custom shape definition for requests that require FormData as the body.

    Type Declaration

      • (defaultValue?: FormData): Shape<TUnsafe<FormData>>
      • Parameters

        • OptionaldefaultValue: FormData

        Returns Shape<TUnsafe<FormData>>

    import {defineService, formDataShape, AnyOrigin, HttpMethod} from '@rest-vir/define-shape';

    export const myService = defineService({
    serviceName: 'my-service',
    serviceOrigin: 'https://example.com',
    requiredClientOrigin: AnyOrigin,
    endpoints: {
    '/my-endpoint': {
    methods: {
    [HttpMethod.Post]: true,
    },
    requestDataShape: formDataShape,
    responseDataShape: undefined,
    },
    },
    });