如何使用Yahoo Pipes设置自定义标头?

时间:2010-09-03 18:44:30

标签: pipe yql yahoo-pipes

我正在管道从私人博主的博客中检索RSS内容。 管道首先向https://www.google.com/accounts/ClientLogin发送POST请求以获取Auth令牌。我使用YQL(select * from htmlpost where url="https://www.google.com/accounts/ClientLogin" and postdata="Email=...)。 问题是,在检索Web内容时,如何在内部使用Auth令牌设置名为“Authenticate”的自定义标头? 我在YQL管道中也没有YQL的经验。我相信我正在努力的是不可能的。有什么想法吗?

2 个答案:

答案 0 :(得分:1)

一种解决方案是创建一个像我自己制作的this one这样的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";

答案 1 :(得分:0)

您仍然需要编写自己的YQL数据表,但我建议您使用YQL内置的 paramType =“header”而不是Pedro的答案。

<key id="Authorization" as="authorization" type="xs:string" paramType="header" required="false" />

YQL documentation关于属性:

  • header:将id及其值作为id:value添加为URL请求的HTTP头。