@Hafeez Ali , Thanks for your question.
I tried the above code at my end and unfortunately, I was not able to reproduce the issue at my end. I was able successfully get the response for the image: https://www.shaadidukaan.com/vogue/wp-content/uploads/2019/08/hug-kiss-images.jpg
The issue might be because of the location / incorrect subscription key.
Please confirm the subscription key used in the code is same as the one in the resource. The headers should be of the below format :
headers = {
# Request headers
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': '440......308',
}
If it persists, please confirm your region endpoint you are making use of.
As per your code you are hitting the WestCentralUs.
conn = http.client.HTTPSConnection('westcentralus.api.cognitive.microsoft.com')
The endpoint would be different as per the location of the Computer Vision resource. If your resource is not in the WestCentralUS, you will have to change this as per the below.
In my case, the resource is in the WestUS location. Hence the endpoint I've used is :
conn = http.client.HTTPSConnection('westus.api.cognitive.microsoft.com')