'problem in the utf-8 encoding of an API response

I am making a request to an API but it does not return the json with format utf-8, for example, the word "Panamá" shows it to me like this: ""Panam\u00e1"", add this to the header of the request http: 'Content -Type ':' application / json; charset = UTF-8 ', verify that if it is being sent in the request but I still receive the same answer. If I make the request from Postman everything is returned well, what could it be? I would be grateful to the one who can help me. Thanks in advance.

so I have the header of my request now:

  headboard = {
    'Accept': 'application/json;charset=utf-8',
    'Authorization': "",
    'Accept-Charset': 'UTF-8'
  }


Solution 1:[1]

The correct HTTP header for requesting JSON as UTF-8 is

Accept: application/json;charset=utf-8

whilst Content-Type is just the descriptive HTTP header containing information for the consumer - which is superfluous if you don't send any data.

Edit: It is also possible to pass the encoding explicitely via the header

Accept-Charset: UTF-8

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1