0

I need to pass my request body to a post method of Web API and in request body have some special characters like ã

Below is the request body :

{
  "query": "den",
  "city": "São Paulo",
  "country": "Brazil",
  "location": null
}

Error : "Unable to translate bytes [E3] at index 32 from specified code page to Unicode."

Anybody has any solution I tried application/json;charset=utf-16 and application/json;charset=utf-8

Also while debugging the code parameter value is coming null.

Thanks

Selim Yildiz
  • 5,254
  • 6
  • 18
  • 28
  • 1
    Possible duplicate of https://stackoverflow.com/questions/39076157/unable-to-translate-bytes-fc-at-index-35-from-specified-code-page-to-unicode – Daniel Crha Oct 17 '19 at 19:37
  • Possible duplicate of [Unable to translate bytes \[FC\] at index 35 from specified code page to Unicode](https://stackoverflow.com/questions/39076157/unable-to-translate-bytes-fc-at-index-35-from-specified-code-page-to-unicode) – craigcaulfield Oct 21 '19 at 21:09

1 Answers1

0

I had the same challenge and I resolved it by adding

(consumes= MediaType.APPLICATION_JSON_VALUE,produces = MediaType.APPLICATION_JSON_VALUE)

with your postMapping.

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
zelshu
  • 1
  • 2