import requests, json, base64
descoded = 'AppKey:keydaminhaempresa, Signature:hash, Env:dev'
user= 'empresa'
passe= textojaembase64
url= ""
body = json.dumps({"token": ""})
#with open(code, 'rb') as f:
#f.splitlines()
headers = {'Content-type': 'application/json'} #, 'Accept': 'text/plain'}
data = ('token')
req = requests.post(url, data=body, auth=(user, passe), headers=headers)
#aa= req.json()
print (req)
content = req.json()
print(content)
Another question
To encode something in python using b64.encode (), I know I should do something like:
with open ('code.txt', 'rb') as f:
f.'Aqui eu nao sei oq colocar'
Thank you to the community of stackoverflow !!