1、application/x-www-form-urlencoded 用于传统表单提交
使用qs库编码数据
axios({
method: "post",
headers: { "content-type": "application/x-www-form-urlencoded" },
data: qs.stringify(data),
url: "/",
});
2、multipart/form-data 常用于文件上传
const form = new FormData();
form.append("my_field", "my value");
form.append("my_buffer", new Blob([1, 2, 3]));
form.append("my_file", fileInput.files[0]);
axios.post("https://example.com", form);