contiamo / restful-react

A consistent, declarative way of interacting with RESTful backends, featuring code-generation from Swagger and OpenAPI specs 🔥
MIT License
1.87k stars 109 forks source link

Support form-data on mutate function (already fixed for useMutate) #346

Closed dcruzin closed 3 years ago

dcruzin commented 3 years ago

This fix is a continuation of #257 and #168.

It applies the same changes made on useMutate to the mutate function.

Without this fix, Content-Type is still being filled as text/plain when it should be set as multipart/form-data by the browser.

This also fixes #264, by not trying to set the default Content-Type if it's already set on mutateRequestOptions.headers.

netlify[bot] commented 3 years ago

Deploy request for restful-react accepted.

Accepted with commit 04a5ed0453a2fef0204095eec03d563409b92c66

https://app.netlify.com/sites/restful-react/deploys/60782af1930a7d000713ad73

fabien0102 commented 3 years ago

@dcruzin Thanks for this PR, should arrive soon in npm (v15.4.2)