【问题标题】:Polymer 2 iron-ajax with handleAs=xml bug?Polymer 2 Iron-ajax 与 handleAs=xml 错误?
【发布时间】:2017-09-27 12:33:40
【问题描述】:

我有以下代码:

<iron-ajax verbose="true" auto method="GET" url="https://localhost/xformupload" handleAs="xml" headers='{"accept" : "text/xml", "mandator" : "xxx", "user" : "xxx", "password" : "xxx"}' params='{"command" : "list"}' on-response="_on_response" last-response="{{response}}"/>

在 Chrome 调试器中查看此请求将正确发送,答案 (xml) 也是正确的。让我抓狂的是,除了 handleAs="xml" 之外的所有内容都将正确设置。

但在发送请求时,在 chrome 调试器 (iron-ajax.html:484) 中 - handleAs 始终(该死)设置为“json”。

在我看来,聚合物不会(!)正确设置 handleAs 属性!

还是我错过了什么?

【问题讨论】:

    标签: xml google-chrome polymer iron-ajax


    【解决方案1】:

    好的,明白了——不能是handleAs,而是handle-as。

    <iron-ajax verbose="true" auto method="GET" url="https://localhost/xformupload" handle-as="xml" headers='{"accept" : "text/xml", "mandator" : "xxx", "user" : "xxx", "password" : "xxx"}' params='{"command" : "list"}' on-response="_on_response" last-response="{{response}}"/>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多