How do I access the response data in an Ajax call? When I log response.text()
, it displays a PromiseObj
.
Console
PromiseObj
context: undefined
promise: Promise {status: "resolved", result: ")]}',↵{\"Result\":\"SUCCESS\",\"Data\":{\"mode\":\"DEV\"}}"}
Code
this.$http.post(endpoint, data, []).then((response) => {
console.log(response.status);
console.log(response.text());
}, (response) => {
console.log(response.status);
console.log(response.json());
});