FSharp.Data
FSharp.Data copied to clipboard
Http Utilities - Encoding problem
I am currently facing an issue using FSharp.Data.Http
to talk to a CouchDb instance. Using curl
and Postman
I am receiving properly encoded responses, like this:
{
"_id": "00000000-0000-0000-0000-000000000008",
"_rev": "1-5e9e6767c8aebeb5748769391716974d",
"start": "2019-05-05T10:00:00",
"kind": {
"id": "00000000-0000-0000-0000-000000000001",
"name": "SE",
"abbreviation": "SE",
"display": {
"color": {
"primary": []
}
}
},
"location": "Düsseldorf",
}
However, using Http.AsyncRequest
the received text seems to not be encoded properly:
{
"id": "00000000-0000-0000-0000-000000000001",
"name": "SE",
"abbreviation": "SE",
"display": {
"color": {
"primary": []
}
},
"location": "Düsseldorf"
}
I've attached an image of the response headers:
Encoding is not specify in headers. Default encoding is UTF-8. You can override encoding with responseEncodingOverride
.
I see. The library doesn't know what kind of encoding to expect since none is returned in the response headers and uses a "fallback" that does not work properly in my case? Thanks for the information!