Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Show Json Data from Python

How do i make Json requests to an endpoint to show the response in Json rather than show the response

i sent a POST request to a server and i am getting this as response.

D:\python>python runVacc.py
<Response [200]>

Which means its a successful request, but i want it to show both the Success as well as the Json Response. My Code is looking thus :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

import requests
import json

url = 'URL HERE'

data = {"email":"developers@flutterwavego.com","is_permanent":True,"bvn":"12345678901","tx_ref":"VAL12","phonenumber":"08098688235","firstname":"John","lastname":"Fish","narration":"Test ACC"}

res = requests.post(url, data=json.dumps(data),headers={'Content-Type':'application/json','Authorization':'Bearer FLWSECK_TEST-2033696a107e162088cdb02f777fa44e-X'})

print(res)

How do I make it to print Json Response containing the Json Data?

Please help, I am new to this.

>Solution :

Use print(res.content) instead.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading