我正在做一个管道来从私人博主的博客中检索 RSS 内容。管道首先向https://www.google.com/accounts/ClientLogin发送 POST 请求以获取 Auth 令牌。我为此使用 YQL ( select * from htmlpost where url="https://www.google.com/accounts/ClientLogin" and postdata="Email=...
)。问题是,在检索网络内容时,如何设置一个名为“Authenticate”的自定义标头,其中包含 Auth 令牌?我在 YQL 和 yahoo 管道中都没有经验。我相信我正在尝试的事情是不可能的。有任何想法吗?
问问题
1302 次
2 回答
1
一种解决方案是创建一个像我自己制作的这样的 yql 表,并将其与 yql 查询一起使用,例如:
use "https://sites.google.com/site/myopentables/html.get.xml?attredirects=0&d=1" as html.get;
select * from html.get where url="someurl" and authorization="auth string";
于 2010-09-18T19:41:14.327 回答
0
您仍然需要编写自己的 YQL 数据表,但我建议您使用 YQL 内置的paramType="header"而不是 Pedro 的回答。
<key id="Authorization" as="authorization" type="xs:string" paramType="header" required="false" />
从关于属性的YQL 文档到:
- header:将 id 及其值作为 id: value 作为 HTTP 标头添加到 URL 请求。
于 2010-10-30T06:53:12.700 回答