Working. I changed it to the following to print out the content, but the prompt iron-request.js:315 The provided value 'application/json' is not a valid enum value of type XMLHttpRequestResponseType.
handleResponse(event) {
let response = JSON.parse(event.detail.response);
console.log(response);
}
Expected outcome
Print out the response results
Actual outcome
VM34783:1 Uncaught SyntaxError: Unexpected token o in JSON at position 1
at JSON.parse (<anonymous>)
at HTMLElement.handleResponse (sample-element.js:30)
at HTMLElement.handler (template-stamp.js:90)
at HTMLElement.fire (legacy-element-mixin.js:440)
at HTMLElement._handleResponse (iron-ajax.js:547)
Description
I use the Drupal jsonapi module to return json data. And then I used this module with polymer, and I got an error when I demo.
Not work. The actual result does not print out the response result
Working. I changed it to the following to print out the content, but the prompt
iron-request.js:315 The provided value 'application/json' is not a valid enum value of type XMLHttpRequestResponseType.
handle function.
Expected outcome
Print out the response results
Actual outcome
Steps to reproduce
package.json
Browsers Affected