FSharp.Data icon indicating copy to clipboard operation
FSharp.Data copied to clipboard

Http Utilities - Encoding problem

Open b0wter opened this issue 5 years ago • 2 comments

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: postman-headers

b0wter avatar Nov 01 '19 15:11 b0wter

Encoding is not specify in headers. Default encoding is UTF-8. You can override encoding with responseEncodingOverride.

fpellet avatar Dec 18 '19 15:12 fpellet

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!

b0wter avatar Jan 08 '20 07:01 b0wter