When I used axios to upload a file to the server as a form, the content of the Content-type I manually set appeared without a semicolon in my actual request headers
To Reproduce
No response
Code snippet
try {
const data = fs.readFileSync(path);
const uint8Array = new Uint8Array(data);
let blob = new Blob([uint8Array],{type:'text/plain'});
const formData = new FormData();
formData.append('file', blob, "1.txt");
const config = {
headers: {
"Content-Type": 'multipart/form-data; boundary=77f77c04-2c7b-4179-aca3-my-cool-boundary'
}
}
const response = axios.post('url',formData,config);
console.log('success:', response);
} catch (error) {
console.error('error:', error);
}
Describe the bug
When I used axios to upload a file to the server as a form, the content of the Content-type I manually set appeared without a semicolon in my actual request headers
To Reproduce
No response
Code snippet
Expected behavior
expected effect: multipart/form-data;boundary=77f77c04-2c7b-4179-aca3-my-cool-boundary
real effect: multipart/form-data boundary=77f77c04-2c7b-4179-aca3-my-cool-boundary
Axios Version
1.6.0
Adapter Version
No response
Browser
Chorme
Browser Version
119.0.6
Node.js Version
16.19.0
OS
window 10
Additional Library Versions
No response
Additional context/Screenshots