-
Notifications
You must be signed in to change notification settings - Fork 10
Fixes #56 ; Don't attempt to set Content-Type header if the request is using multipart-formdata #57
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
base: main
Are you sure you want to change the base?
Conversation
…uest is using multipart-formdata
@@ -125,6 +125,7 @@ export const {{className name}}ApiFetchParamCreator = function (configuration?: | |||
|
|||
{{/if}} | |||
{{#with requestBody}} | |||
{{#ifeq (isContentMultipart defaultContent) false}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could use not
instead of ifeq false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried a few iterations. There's no not
usage anywhere I can see. Is {{#unless}}
the thing I want?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've used {{#unless}}
.
… of {{#ifeq (isContentMultipart defaultContent) false}}
… will consume multipart/form-data
… to add the MultipartProvider so we can parse the params
…t should deserialize them.
…od to discern if an endpoint consumes multipart/* as `isContentMultipart()`
…ore type-safe, consistent and correct
I have tested this for both typescript-fetch-client and typescript-fetch-client2