Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/multipart formdata #18

Open
wants to merge 2 commits into
base: typescript-axios
Choose a base branch
from

Conversation

jackjocross
Copy link

No description provided.

let hasFile = false;
{{#formParams}}
{{#isFile}}hasFile = true;
{{/isFile}}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be a ternary?

let data: any;

if (hasFile) {
headers = { 'Content-Type': 'multipart/form-data' };

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we learned, I think you want to leave this header off and let FormData apply the header itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants