4

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

F.M.F.
  • 1,929
  • 3
  • 23
  • 42

1 Answers1

7

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);
});
Ken Tan
  • 700
  • 6
  • 15