Skip to content

Feature/multipart formdata#18

Open
jackjocross wants to merge 2 commits into
palmerhq:typescript-axiosfrom
jackjocross:feature/multipart-formdata
Open

Feature/multipart formdata#18
jackjocross wants to merge 2 commits into
palmerhq:typescript-axiosfrom
jackjocross:feature/multipart-formdata

Conversation

@jackjocross
Copy link
Copy Markdown

No description provided.

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

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' };
Copy link
Copy Markdown

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