question

Mike-Ubezzi-MSFT avatar image
0 Votes"
Mike-Ubezzi-MSFT asked ·

What are the extra headers in my bing image search API response?

"I am seeing the following headers in my bing image search API.

 X-MSEdge-ClientID
 BingAPIs-Market
 BingAPIs-TraceId

What is the significance of these fields and how do we interpret them?"

[Note: As we migrate from MSDN, this question has been posted by an Azure Cloud Engineer as a frequently asked question] Source: MicrosoftDocs


azure-bing-image
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

RohitMungi-7434 avatar image
0 Votes"
RohitMungi-7434 answered ·

The following headers may occur in responses from the Bing Image Search API.

 X-MSEdge-ClientID: The unique ID that Bing has assigned to the user
 BingAPIs-Market: The market that was used to fulfill the request
 BingAPIs-TraceId: The log entry on the Bing API server for this request (for support)

It is particularly important to persist the client ID and return it with subsequent requests. When you do this, the search will use past context in ranking search results and also provide a consistent user experience.

However, when you call the Bing Image Search API from JavaScript, your browser's built-in security features (CORS) might prevent you from accessing the values of these headers.

To gain access to the headers, you can make the Bing Image Search API request through a CORS proxy. The response from such a proxy has an Access-Control-Expose-Headers header that whitelists response headers and makes them available to JavaScript.

The steps to install the same are available at the link below:

https://docs.microsoft.com/en-us/azure/cognitive-services/bing-image-search/bing-image-search-resource-faq#response-headers-in-javascript

Source: Azure Documentation



·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.