Reputation: 3227
To me, this code is the same, however in Chrome Dev Tools, the first request has the payload set:
But the second doesn't. Any ideas?
Upvotes: 0
Views: 1370
Reputation: 5411
Based on an example from Axios Github page, the data
property contains the payload
// Send a POST request
axios({
method: 'post',
url: '/user/12345',
data: {
firstName: 'Fred',
lastName: 'Flintstone'
}
});
So, in your second request, you should change body to data
Upvotes: 2