次のような axios で API メソッドを呼び出しています。
let promise = axios.get('http://localhost:63711/api/AdminAPI/GetHomeCarousel');
console.log(promise);
promise.then(function(response){
console.log(response);
});
両方の console.log が出力を出力します。
Promise {[[PromiseStatus]]: "pending", [[PromiseValue]]: undefined}
API はGET
有効な json データを返しています。POSTMAN 経由で次のように確認しました。
[
{
"type": "image",
"mediaUrls": [
"\\wwwroot\\11863226_431355017048701_7276274176291220216_n.jpg"
],
"title": "title 1",
"description": "<p>Check pic </p>\r\n<p>test yy jjasd</p>",
"url": "\\NdbSite\\wwwroot\\11863226_431355017048701_7276274176291220216_n.jpg",
"buttonText": "",
"featuredProduct": "",
"featuredProductUrl": ""
}
]
私はついていきます :
http://codeheaven.io/how-to-use-axios-as-your-http-client/
私は何が欠けていますか?