Create a new resource
Sends a POST request to create a new resource on the server.
Type of the input data
Type of the response data
API endpoint URL
Data to send in the request body
Promise resolving to the created resource
const user = await createResource<UserInput, User>('/api/users', { name: 'John Doe', email: 'john@example.com'}); Copy
const user = await createResource<UserInput, User>('/api/users', { name: 'John Doe', email: 'john@example.com'});
Create a new resource
Sends a POST request to create a new resource on the server.