Open dabukster opened 6 years ago
I'm using Polymer 2.0 and I want to set a custom header, like "x-personal-header": "some value"
"x-personal-header": "some value"
<iron-ajax id="save" method="PUT" url="http://remotehost.net:9470/backend/resources/entities/Printer" body='{{currentItem}}' headers='{"access-control-allow-origin": "*"}' on-error="_handleError" handle-as="json" on-response="_handleResponse" debounce-duration="300"></iron-ajax>
...other headers omitted... x-personal-header: what
...other headers omitted... Access-Control-Request-Headers:x-personal-header
iron-ajax
headers='{"access-control-allow-origin": "*"}'
this.$.save.generateRequest()
@dabukster I was having this problem as well, turns out I needed to add an Access-Control-Allow-Headers header in the server response, like so:
Access-Control-Allow-Headers: *
Description
I'm using Polymer 2.0 and I want to set a custom header, like
"x-personal-header": "some value"
Expected outcome
Actual outcome
Steps to reproduce
iron-ajax
element in the page and set headersheaders='{"access-control-allow-origin": "*"}'
this.$.save.generateRequest()
Browsers Affected