1
我是新來的角,我已經創建了一個Web API REST服務和一個簡單的客戶端進行GET請求。
它調用本地主機時工作正常,但是當我移動到不同的服務器,我得到404種狀態,即使我能看到提琴手200個狀態,我需要的JSON。
兩個請求和響應的外觀是相同的,我所看到的所有職位上有關刪除,我已經做了標題。
我採用了棱角分明1.2.10和JQuery 1.11.0
有誰知道我錯過了任何其他問題。
typescript class being called
export class SearchService {
http: ng.IHttpService;
constructor($http) {
this.http = $http;
}
SearchPages(successCallback: Function, searchFor: string): void {
delete this.http.defaults.headers.common['X-Requested-With'];
this.http.get("http://www.?????.com/????/api/search/" + searchFor).success(function (data, status) {
successCallback(data);
}).error(function (data, status, headers) {
var tt: string = "Error";
});
}
}
千恩萬謝
代碼請.... – Prashobh
看看你鉻devtool的 「網絡」 面板,它可能是一個CORS預flig ht問題。更多https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS –