@Ammar Mohanna I think the body is not passed correctly in the above case. Try this snippet and it should provide you with the operation location that can be used to get the end result of the analyze operation using Read Result API.
import json, base64
import http.client, urllib.request, urllib.parse, urllib.error
headers = {
'Content-Type': 'application/octet-stream',
'Ocp-Apim-Subscription-Key': 'key',
}
params = urllib.parse.urlencode({
'language': 'en',
'pages': 'all',
# 'readingOrder': '{string}',
# 'model-version': '{string}',
})
with open("C:\\Users\\user\\Pictures\\image.jpg", "rb") as image_file:
body = image_file.read()
try:
conn = http.client.HTTPSConnection('your_region.cognitiveservices.azure.com')
conn.request("POST", "/vision/v3.2/read/analyze?%s" % params, body, headers)
response = conn.getresponse()
#data = response.read()
print(response.headers)
conn.close()
except Exception as e:
print("[Errno {0}] {1}".format(e.errno, e.strerror))
Response: