首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Stumbleupon API url编码问题

Stumbleupon API url编码问题
EN

Stack Overflow用户
提问于 2011-09-26 08:11:47
回答 1查看 1.2K关注 0票数 2

我正在尝试使用stumbleupon来获取关于我的站点上的项目的信息。

文档:http://www.stumbleupon.com/help/badge-api-documentation/

现在它运行得很完美,除了一些URL的..。

但是,例如,http://lolbin.net/i/fp16jU82/that's-what-beer-is-for.htm在URL中有一个‘,这是Stumbleupon的一个问题。

我尝试过各种各样的东西,但是我不断地得到错误页面:

代码语言:javascript
复制
http://www.stumbleupon.com/services/1.01/badge.getinfo?url=http://lolbin.net/i/fp16jU82/that's-what-beer-is-for.html

http://www.stumbleupon.com/services/1.01/badge.getinfo?url=http://lolbin.net/i/fp16jU82/that\'s-what-beer-is-for.html

http://www.stumbleupon.com/services/1.01/badge.getinfo?url=http://lolbin.net/i/fp16jU82/that%27s-what-beer-is-for.html

http://www.stumbleupon.com/services/1.01/badge.getinfo?url=http://lolbin.net/i/fp16jU82/that%252527s-what-beer-is-for.html

该项目已在stumbleupon数据库中,具有多个视图:http://www.stumbleupon.com/url/lolbin.net/i/fp16jU82/that%252527s-what-beer-is-for.html

我的问题是,如何通过API查询这个特定项,以便获得有效的返回?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-09-26 08:36:25

它适用于%2527

代码语言:javascript
复制
http://www.stumbleupon.com/services/1.01/badge.getinfo?url=http://lolbin.net/i/fp16jU82/that%2527s-what-beer-is-for.html

返回:

代码语言:javascript
复制
{"result":{"url":"http:\/\/lolbin.net\/i\/fp16jU82\/that%27s-what-beer-is-for.html",
"in_index":true,"publicid":"Aq9jhK","views":262882,
"title":"Thats what beer is for - LOLBIN.net","thumbnail":"http:\/\/cdn.stumble-upon.com\/mthumb\/767\/82718767.jpg",
"thumbnail_b":"http:\/\/cdn.stumble-upon.com\/altbthumb\/767\/82718767.jpg","submit_link":
"http:\/\/www.stumbleupon.com\/submit?url=http:\/\/lolbin.net\/i\/fp16jU82\/that%27s-what-beer-is-for.html","badge_link":
"http:\/\/www.stumbleupon.com\/badge?url=http:\/\/lolbin.net\/i\/fp16jU82\/that%27s-what-beer-is-for.html",
"info_link":"http:\/\/www.stumbleupon.com\/url\/lolbin.net\/i\/fp16jU82\/that%252527s-what-beer-is-for.html"},
"timestamp":1317025970,"success":true}

正如戈迪厄斯所指出的那样,这是一种双重密码。‘=> %27 => %2527

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7552286

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档