且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

搜索API - 使用PHP和cURL时出现V5:404错误

更新时间:2023-02-22 16:02:58

你好

我确实发现你只是在发送请求标头中的Ocp-Apim-Subscription-Key。除此之外,必须将以下(用户代理,客户端IP,客户端ID,主机)作为请求标头的一部分发送。

I do observe that you are sending only Ocp-Apim-Subscription-Key in the request header. In addition to that, the following ones (user-agent, client ip, client id, host) have to be sent as part of the request header.

User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 822) X-Search-ClientIP: 999.999.999.999 X-MSEdge-ClientID: <blobFromPriorResponseGoesHere> Host: api.cognitive.microsoft.com

了解更多详情,https://msdn.microsoft.com/en-us/library/dn760781.aspx#fullrequest

for more details, https://msdn.microsoft.com/en-us/library/dn760781.aspx#fullrequest

谢谢