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

fix: only serialize JSON bodies #80

Merged
merged 2 commits into from
May 20, 2022
Merged

fix: only serialize JSON bodies #80

merged 2 commits into from
May 20, 2022

Conversation

P4sca1
Copy link
Contributor

@P4sca1 P4sca1 commented May 10, 2022

Previously, everything that looked like it could be serialized, was actually serialized, no matter what content type was set.
This includes arbitrary strings. When you tried to send a string like key "myval" to the server using ohmyfetch, the server received "key \\"myval\\"".

Closes #58

src/fetch.ts Show resolved Hide resolved
@pi0
Copy link
Member

pi0 commented May 11, 2022

Thanks!

@pi0 pi0 merged commit dc237d4 into unjs:main May 20, 2022
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.

[BUG] About send a request with body text type
2 participants