xmlgoogle-chromepolymeriron-ajax

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. What drives me crazy here is that everything except the handleAs="xml" will be set correctly.

But within the chrome debugger (iron-ajax.html:484) when the request is send - handleAs is always (damned) set as "json".

Looks to me like polymer will not(!) set handleAs attribute correctly!

Or did I miss something?


Solution

  • Ok, got it - must not be handleAs, but 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}}"/>