Request URL not working?

Nezar ElKhuffash 1 Reputation point
2020-11-21T14:26:39.747+00:00

Trying to request URL so i can use computer vision as an extension in MIT app inventor. Despite using both keys and regenerating a few times, I keep running into error 400 bad request.

Request URL:
https://canadacentral.api.cognitive.microsoft.com/vision/v3.0/describe?maxCandidates=1&language=en

HTTP request
OST https://canadacentral.api.cognitive.microsoft.com/vision/v3.0/describe?maxCandidates=1&language=en HTTP/1.1
Host: canadacentral.api.cognitive.microsoft.com
Content-Type: application/json
Ocp-Apim-Subscription-Key: ••••••••••••••••••••••••••••••••

{"url":"http://example.com/images/test.jpg"}

Response status

400 Bad Request
Response latency
154 ms
Response content

Transfer-Encoding: chunked
x-envoy-upstream-service-time: 104
CSP-Billing-Usage: CognitiveServices.ComputerVision.Transaction=1
apim-request-id: 1ff77d31-5824-4243-8fd9-41780deeaa9b
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
x-content-type-options: nosniff
Date: Sat, 21 Nov 2020 13:49:28 GMT
Content-Type: application/json; charset=utf-8

{
"code": "InvalidImageUrl",
"requestId": "1ff77d31-5824-4243-8fd9-41780deeaa9b",
"message": "Image URL is not accessible."
}

Azure Computer Vision
Azure Computer Vision
An Azure artificial intelligence service that analyzes content in images and video.
371 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. romungi-MSFT 45,556 Reputation points Microsoft Employee
    2020-11-23T07:13:30.837+00:00

    @Nezar ElKhuffash The URL used in the request "http://example.com/images/test.jpg" is not a valid URL with an image. You could try a different URL, for example the following JPG image which is directly available from wikipedia website.

    https://upload.wikimedia.org/wikipedia/commons/thumb/1/12/Broadway_and_Times_Square_by_night.jpg/450px-Broadway_and_Times_Square_by_night.jpg

    Please ensure the image URL is not behind a CDN as those links cannot be accessed by the API to run the operation.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.