import requests, json url="https://southcentralus.api.cognitive.microsoft.com/customvision/v3.0/Prediction/d96305a9-8d18-4ac3-8f37-a5e493ce6243/classify/iterations/Iteration1/image" headers={'content-type':'application/octet-stream','Prediction-Key':'06d4a646232c4091884e1e98cd4a253b'} r =requests.post(url,data=open("test.jpg","rb"),headers=headers) print(r.content)