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

Support for FormData #127

Closed
cloudsere opened this issue Sep 7, 2021 · 1 comment
Closed

Support for FormData #127

cloudsere opened this issue Sep 7, 2021 · 1 comment

Comments

@cloudsere
Copy link

cloudsere commented Sep 7, 2021

Hi, does o.js plan to support FormData

I noticed that there're code in OHandler.ts which do a JSON.stringify on request body, which is not needed if the request body is FormData.

return JSON.stringify(body);

@janhommes
Copy link
Owner

janhommes commented Sep 7, 2021

but it's only doing it if the type is object... otherwise, it is returning the body. So it should be already supported, or do you face any issues? Maybe the type check is not correct :/

https://stackoverflow.com/questions/46146637/detect-if-javascript-object-is-a-formdata-instance

maybe we need to use instanceof?

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

No branches or pull requests

2 participants