Can not change Contant-Type when data is FormData
See original GitHub issueaxios({
method: "PUT",
url: url,
transformRequest: [function (data, headers) {
// Do whatever you want to transform the data
return formData;
}],
headers: {
'Content-Type': file.type
},
"withCredentials": false
});
Launched request with Content-Type: Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryPz13ZA77aLqgPlwB
Issue Analytics
- State:
- Created 5 years ago
- Reactions:9
- Comments:16 (3 by maintainers)
Top Results From Across the Web
Not able to send formData to the server - Stack Overflow
I am using Angular framework ,; Where I am trying to send data to the server via FormData; I ...
Read more >[Solved]-Facing problem in sending form data on the server-angular.js
You can not directly print FormData to console.log(), You need to use methods of ... change contant type from headers = headers.append('Content-Type', ...
Read more >Orckestra/C1-CMS - Gitter
Hi. I've recently added two new fields to an in-use page datatype on my home machine and everything works as it should. However,...
Read more >axios - Bountysource
Trying to send a request (no matter what) the timeout will be ignored and is ... Getting network error when sending form data...
Read more >3.1.0-beta2 | Silverstripe CMS Documentation
This version of Silverstripe CMS will not recieve any additional bug fixes or ... Changed action handling and allowed_actions to make more secure...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s because of this part https://github.com/axios/axios/blob/master/lib/adapters/xhr.js#L18-L20 Looks like it was first reported in 2017 https://github.com/axios/axios/issues/767 but was closed without being fixed
Removing this part worked for me
One really ugly hack, without rewriting the app would be to hack object’s prototype. This will make
Content-type
stay as it is.