在Bing Web Search API中接收截断的显示URL对长URL的响应 [英] Receiving Truncated Display URLs in Bing Web Search API Response for long URLs

查看:110
本文介绍了在Bing Web Search API中接收截断的显示URL对长URL的响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello

我最近在我们的一个应用程序中集成了Bing的Web搜索API的免费版本。我确实注意到,只要长URL位于关键displayUrl的API响应中,就会发现截断的网址。

I had recently integrated the Free version of the Web Search API of Bing in one of our applications. I did notice truncated URLs whenever long URLs are in the API response for the key displayUrl.

以下内容来自Bing API响应,关键字

The following is taken from the Bing API response, for a keyword,

例子:

example:

[7] => Array
        (
            [@type] => s:WebPage
            [@id] => #WebPages.7
            [s:name] => Spotify CEO pens blogpost on Taylor Swift and the state of ...
            [s:url] => https://www.bing.com/cr?IG=7A9C5C198949437CAC41ABA3518A6741&CID=11141AD6B6D66AFF052A1343B7E76BD2&rd=1&h=8rUyXFXZD_511eWW13JDkB7GnTpXx4yCBEdSOlXs7ZU&v=1&r=https%3a%2f%2fwww.engadget.com%2f2014%2f11%2f13%2fspotify-ceo-pens-blogpost-on-taylor-swift-and-the-state-of-music%2f&p=DevEx,5192.1
            [s:thumbnailUrl] => https://www.bing.com/th?id=https%3a%2f%2fs.aolcdn.com%2fdims5%2famp%3adb6f87d97529b8b6b2e1b4035393b0626c592167%2ft%3a1200%2c630%2fq%3a80%2f%3furl%3dhttps%253A%252F%252Fs.aolcdn.com%252Fdims-shared%252Fdims3%252FGLOB%252Fcrop%252F4926x3279%252B1%252B0%252Fresize%252F590x393%2521%252Fformat%252Fjpg%252Fquality%252F85%252Fhttp%253A%252F%252Fhss-prod.hss.aol.com%252Fhss%252Fstorage%252Fmidas%252F6d70403e0ae4d26a807b2b2df16b2c88%252F201085509%252F458314418.jpg&w=70&c=1&pid=5.1
            [displayUrl] => https://www.engadget.com/2014/11/13/spotify-ceo-pens-blogpost-on...
            [snippet] => Last week, Taylor Swift abruptly removed all of her music from Spotify, a significant move considering that Swift's latest album 1989 has been perched at the top of ...
            [dateLastCrawled] => 2016-08-31T17:05:00
        )

请注意,displayUrl值在这里被截断,

Please observe, displayUrl value is truncated here,

https://www.engadget.com/2014/11/13/spotify-ceo-pens-blogpost-on...

同时,实际网址是,

https://www.engadget.com/2014/11/13/spotify-ceo-pens-blogpost-on-taylor-swift-and-the-state-of-music/

https://www.engadget.com/2014/11/13/spotify-ceo-pens-blogpost-on-taylor-swift-and-the-state-of-music/

注意:这个实际网址可以通过触发s的值来获得:url ie,

Note: This actual url can be obtained by triggering the value of s:url i.e,

https://www.bing.com/cr?IG=7A9C5C198949437CAC41ABA3518A6741&CID=11141AD6B6D66AFF052A1343B7E76BD2&rd=1&h=8rUyXFXZD_511eWW13JDkB7GnTpXx4yCBEdSOlXs7ZU&v=1&r=https%3a%2f%2fwww.engadget.com%2f2014%2f11%2f13%2fspotify-ceo-pens-blogpost-on-taylor-swift-and-the-state-of-music%2f&p=DevEx,5192.1




------

一些参考文献:

https://social.msdn。 microsoft.com/Forums/en-US/c1881609-d39d-4c15-95a1-3b31ab8859ae/display-urls-truncated-in-bing-api-response?forum=DataMark等

https://social.msdn.microsoft.com/Forums/en-US/c1881609-d39d-4c15-95a1-3b31ab8859ae/display-urls-truncated-in-bing-api-response?forum=DataMarket

https://social.msdn.microsoft.com/Forums/en-US/4c26b4d6-ffb4-41a8-b1c7-e094868cc89a/bing-api-response-resulting-in-shortened-or- truncated-display-url?forum = mlapi

https://social.msdn.microsoft.com/Forums/en-US/4c26b4d6-ffb4-41a8-b1c7-e094868cc89a/bing-api-response-resulting-in-shortened-or-truncated-display-url?forum=mlapi

在确定Bing API Response for Web Search API为long URL Scenario提供截断的URL后,我问这个问题(值displayUrl key),

I am asking this question after making sure that the Bing API Response for Web Search API is giving truncated URLs for long URL Scenario (value of displayUrl key),

请帮助获取displayUrl值的完整URL,

please help with getting the complete URL for the displayUrl value,

谢谢

推荐答案

这是设计的,其中URL仅用于显示目的而且格式不正确。

This is by design where the URL is meant for display purposes only and is not well formed.


这篇关于在Bing Web Search API中接收截断的显示URL对长URL的响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆