简体   繁体   English

聚合物 2 铁 ajax 与 handleAs=xml 错误?

[英]Polymer 2 iron-ajax with handleAs=xml bug?

I have the following code:我有以下代码:

<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}}"/>

Reviewing this within Chrome debugger the request will be send correctly, also the answer (xml) is correctly.在 Chrome 调试器中查看此请求将正确发送,答案 (xml) 也是正确的。 What drives me crazy here is that everything except the handleAs="xml" will be set correctly.让我发疯的是,除了 handleAs="xml" 之外的所有内容都将被正确设置。

But within the chrome debugger (iron-ajax.html:484) when the request is send - handleAs is always (damned) set as "json".但是在 chrome 调试器 (iron-ajax.html:484) 中发送请求时 - handleAs 总是(该死的)设置为“json”。

Looks to me like polymer will not(!) set handleAs attribute correctly!在我看来,聚合物不会(!)正确设置 handleAs 属性!

Or did I miss something?还是我错过了什么?

好的,明白了 - 不能是 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}}"/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM