I am using <iron-ajax>
like as :
<iron-ajax id="dataAjax" url={{url}} method="POST" handle-as="json" params="{{getParam()}}" on-response="createResp" last-response="{{ajaxResponse2}}"></iron-ajax>
When i Check in Network tab in Chrome, response is coming, but because of following error createResp
does not execute.
XMLHttpRequest cannot load http://...URL.... No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access.
I tried with this:
_handleError:function(event){
console.log(event.detail.request.xhr.response); //null
}
but i got null, but in network tab i am able to see the response.
And also status is 200
Can anyone help me how to get the response.