Const
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,
},
},
});
A custom shape definition for requests that require
FormData
as the body.