Im using axios on my react app to send a delete request, I need to send an id list as payload but it returns "415 Unsupported Media Type".
Here's my code:
const deviceData = ["31234"];
axios.delete(url, { data: deviceData }).then(res => {
if (res.status === 200) {
const pagination = { ...this.state.pagination };
this.setState({
loading: false,
data: res.data.data.devices,
pagination
});
}
});