brazilcep
brazilcep copied to clipboard
Add support to proxy setting
Sometimes is necessary to add proxies different than the local ones. I would like to be able to set this while requesting to the correios API. Thanks!
@nicolasassi thanks. I will work in this feature.
Nice! I think it would be a fun improvement to your already awesome solution. As I was in a rush I did it myself, but I'll paste my code here as it my help someone while you are developing the
import requests
import zeep
p = {'https': "00.00.000.000", 'http': '00.00.000.000'}
s = requests.session()
s.proxies.update(p)
t = zeep.Transport(session=s, timeout=20)
url="https://apps.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente?wsdl"
client = zeep.Client(url, transport=t)
endereco = client.service.consultaCEP('22795175')