【问题标题】:How to set a custom header using Yahoo Pipes?如何使用 Yahoo Pipes 设置自定义标题?
【发布时间】:2010-09-03 18:44:30
【问题描述】:

我正在使用管道从私人博主的博客中检索 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 管道中都没有经验。我相信我正在尝试的事情是不可能的。有什么想法吗?

【问题讨论】:

    标签: pipe yql yahoo-pipes


    【解决方案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";
    

    【讨论】:

      【解决方案2】:

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

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

      YQL documentation关于属性到:

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-10-27
        • 2018-02-04
        • 1970-01-01
        • 2014-10-24
        相关资源
        最近更新 更多