fsprojects / FsHttp

A lightweight F# HTTP library by @SchlenkR and @dawedawe
https://fsprojects.github.io/FsHttp/
Apache License 2.0
424 stars 42 forks source link

Content type 'text/json' should be 'application/json' #93

Closed drhumlen closed 2 years ago

drhumlen commented 2 years ago

application/json is actually the correct type, not text/json. This actually caused the server I made http requests towards to fail because it didn't recognize text/json as a valid type.

drhumlen commented 2 years ago

https://github.com/fsprojects/FsHttp/pull/94

SchlenkR commented 2 years ago

According to this post, RFC 4627 and personal experience, the mime type of choice should indeed be application/json instead of text/json.

I will merge the linked PR. Since this might be a breaking change to some applications, this will be included in the next major release 8.

As a workaround, please have a look at the test Explicitly specified content type is dominant, which shows how to force a specified content type.

Thanks for your issue and the PR, @drhumlen