-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
the request body couldn't be sent correctly if content set to 'application/json; charset=utf-8' #90
Comments
Hi @lopaz, thanks for reporting the issue!
I think this is a bug, With that said, in theory according to
I also noticed that browsers often override the content-type value regardless of the fetch options. So in practice, in that context omitting the charset should not matter since browsers add the value themselves. |
I just released version |
@elbywan Good job. I didn't realize the charset-overwritten issue. There's still another one, using |
Confirmed, fixed in 1.7.4 👍 |
the following code doesn't work:
wretch().content('application/json; charset=utf-8').url('http://...').post(json)
it seems that
charset=utf-8
is not allowed:wretch/src/wretcher.ts
Lines 199 to 206 in 2631890
wretch/src/wretcher.ts
Lines 12 to 13 in 2631890
not sure if this is a bug, since json is the default content-type and utf-8 is the default chareset for json, which means
content('application/json; charset=utf-8')
is totally redundant.The text was updated successfully, but these errors were encountered: