Python 3 Consumption API, does not bring json dump ?? It's got 200! OK, but at json it's error 400 (authentification)

0
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 !!

    
asked by anonymous 07.10.2018 / 18:13

0 answers