'Content-Type': 'multipart/form-data' Can not work normally
See original GitHub issueI use {‘Content-Type’: ‘multipart / form-data’} to upload files but not work I use the following code:
let formBox = new FormData();
formBox.append('file', files[0]);
axios({
method: 'post',
url: api.pushZipFile,
data: formBox,
headers: {'Content-Type': 'multipart/form-data'}
})
Return the following results:
I refer to Issues to find a solution, but it did not succeed. https://github.com/mzabriskie/axios/issues/318
Issue Analytics
- State:
- Created 6 years ago
- Comments:15
Top Results From Across the Web
Content type 'multipart/form-data;boundary - Stack Overflow
I just noticed, you have set contentType=false while making ajax request. Are you certain that it is correct. Maybe you need to pass...
Read more >[Multipart/form-data] Getting a wrong media file typer error on ...
I keep getting a response error stating the media file type is incorrect. BTW: the text to binary does not seem to work...
Read more >POST - HTTP - MDN Web Docs
The HTTP POST method sends data to the server. The type of the body of the request is indicated by the Content-Type header....
Read more >Multipart/form-data content type - Software AG Documentation
Represents a binary part of a multipart/form-data payload where the content of the part is binary or the content of the file itself....
Read more >RFC1341(MIME) : 7 The Multipart content type
A body part is NOT to be interpreted as actually being an RFC 822 message. ... All other header fields are generally to...
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 Free
Top 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
I get the same ‘[object Object]’ string in the payload. Anyone figure this out?
Got into the same problem. Applying your workaround, do you also see as
request payload
in chrome[object Object]
?