question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Form data - start boundary issue

See original GitHub issue

I’m trying to send the form data to the api, so appended the file to formData formData.append('file', file.data, {filename: file.name}); and setting formData to axiosOptions.data for axios(axiosOption)

On not sending Content-type in headers, it is set to the default value application/x-www-form-urlencoded. If I send Content-type = multipart/form-data with/without boundary appended, I get this error on the api which says that the start boundary wasn’t defined for the mime message.

As per all the docs and discussions of axios, content-type should have been set itself. But even when I set it explicitly, the above error occurs.

Any idea what I am missing?

@nickuraltsev @mzabriskie

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
antoinereycommented, Dec 1, 2016

@nickuraltsev

I get the exact same issue as @ronaldcurtis. I tried to make it work, but couldn’t. I always get the same results :

  1. The request Content-Type header is always application/json
  2. The FormData instance seems to be transformed into a standard JS object

I tried multiple browsers :

  1. Firefox 48.0.1
  2. Firefox 49.0.2
  3. Firefox 50.0.2
  4. Chrome 54.0

And multiple Axios versions :

  1. 0.13.1
  2. 0.14.0
  3. 0.15.0
  4. 0.15.1
  5. 0.15.2
  6. 0.15.3

@ronaldcurtis Did you find any workaround ? @nickuraltsev Do you have any idea where it could come from ? I could look into it and try to solve this.

1reaction
mwcbrentcommented, Aug 5, 2016

Nevermind - we found the issue was that we were passing in a header to our axios options and it was overriding the functionality built into Axios. This feature works and this issue should be closed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is the boundary in multipart/form-data? - Stack Overflow
Great answer. A boundary is just the 'key' to separate the multiple "parts" of a multipart payload. Normally something like '&' is enough...
Read more >
Understanding Boundary In Multipart/Form-Data - Roy Tutorials
Boundary in Form Data I am going to discuss here what is boundary in multipart/form-data which is mainly found for an input type...
Read more >
How to change "multipart/form-data" boundary for an incoming ...
The article discusses the method to change the boundary of the "multipart/form-data" for an incoming HTTP request message.
Read more >
Boundary delimiter for HTTP file posts is static. That is wrong ...
Boundary delimiter for HTTP file posts is static. That is wrong according to RFC.
Read more >
Missing boundary in multipart/form-data POST - fetch - YouTube
JavaScript : fetch - Missing boundary in multipart/ form - data POST [ Gift : Animated Search Engine : https://bit.ly/AnimSearch ] JavaScript ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found