I'm experimenting with reactjs and .net core web api, and I'm trying to send simple list of integer to the rest api. Throught postman I did it without any issues, but when I try to do it from my react js code I'm getting 415 error in a console:
This is how my method on the API looks:
// DELETE api/SiteUsers/delete
[HttpPost("delete")]
public async Task<ActionResult> DeleteSiteUsers(DeleteValuesDto deleteValues, CancellationToken cancellationToken)
{
return NoContent();
}
Here is how my DeleteValuesDto looks like:
On the frontend I made simple method which should make an api call to rest api:
const handleDelete = async () => {
var deleteValues = {
values: selectedRows,
};
await deleteSiteUser(deleteValues);
};
Here is my deleteSiteUser method on frontend:
export const deleteSiteUser = (deleteValues) => {
console.log('deleteValues', deleteValues);
return axiosWrapper.request({
url: `/SiteUsers/delete`,
method: 'POST',
deleteValues,
});
};
Here are the results of console log:
I thought this would be very simple, but I find out it isn't actually :/

