Here is the current code structure:
Polymer('my-element', {
created: function() {
this.data = {
name: 'John Doe',
email: '<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3a505552547a5e555f14595557">[email protected]</a>'
};
},
handleResponse: function(e, d) {
console.log(d.response);
}
});
<core-ajax
id="ajax"
auto
url="/test"
method="POST"
handleAs="json"
body="{{data}}"
on-core-response="{{handleResponse"}}>
</core-ajax>
I have set up a server to return the body of the POST message when it is posted to /test.
app.post('/test', function(req, res) {
res.json(req.body);
}
However, the response I am receiving on the console is as follows:
Object {object Object: ""}