Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Axios: Send null value as param in request

Is there a possibility to pass a parameter with the value of null to axios? It seems that null values are just ignored...

like image 988
F.M.F. Avatar asked Oct 24 '25 21:10

F.M.F.


1 Answers

An empty string should do the trick.

var data = new FormData();
data.append('location_id', '');
axios.post('/location/update', data)
.then(function(response) {
    console.log(response.data);
})
.catch(function(error) {
    console.log(error);
});
like image 169
Ken Tan Avatar answered Oct 26 '25 22:10

Ken Tan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!