Axios:在请求中发送空值作为参数

F.M*_*.F. 4 http-request-parameters axios

是否可以将值为 null 的参数传递给 axios?似乎空值被忽略了......

Ken*_*Tan 7

空字符串应该可以解决问题。

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);
});
Run Code Online (Sandbox Code Playgroud)