I'm studying Requests in Python and I'm trying to get the data from the zip code: link
p> I can get it, but when it comes to showing them, since I live in São Paulo because of the encoding I get: S\u00e3o Paulo
Reading the requests tab ( link ) I know that it's possible to fix this using r.encoding, but I'm not getting it. What am I doing wrong?
import requests
CEP = 'http://api.postmon.com.br/v1/cep/'+ '01001001'
r = requests.get(CEP)
r.encoding = 'ISO-8859-1'
print r.text
Result:
{"complement": "par side", "neighborhood": "S", "city": "S \ u00e9 Paulo "," public place ":" Praça da da à "," estado_info ": {"area_km2": "248.221.996", "codigo_ibge": "35", "name": "S \ u00e3o" Paulo "}," cep ":" 01001001 "," cidade_info ": {" area_km2 ":" 1521,11 ", "code": "3550308"}, "status": "SP"}