2017-09-20 9 views
0

このWebサービスからの応答を受け取れないのはなぜですか?なぜこのWebサービスから応答を受け取ることができないのですか?

$(document).ready(function() { 
    $.ajax({ 
     url: "https://aip-rest.appspot.com/api/token/12416689" 
    }).then(function(data) { 
     $('.greeting-id').append(data.id); 
     $('.greeting-content').append(data.content); 
    }); 
}); 

私はhttp://rest-service.guides.spring.io/greetingと同じコードをテストしているし、それが働いています。あなたはAJAX呼び出しにそれを示すために持っているので、

+0

に思えるそのHTTPSの応答://aip-rest.appspot.com/api/token/12416689 "id"や "content"はありません。 – Pang

答えて

0

Webサービスhttps://aip-rest.appspot.com/api/token/12416689が、私はそれが役に立てば幸い

$.ajax({ 
    type: "GET", 
    url: "https://aip-rest.appspot.com/api/token/12416689", 
    cache: false, 
    dataType: "xml", 
    success: function(xmlData) { 
     // Fetch your $(xmlData) to extract what you need 
    } 
}); 

...、あなたはXMLレスポンスを与えている

関連する問題