Axios: send null as parameter in request

Is it possible to pass a null parameter to axios? It seems that null values ​​are just being ignored ...

+3


source to share


1 answer


An empty line 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);
});

      

+2


source







All Articles