0
我在使用$.getJSON
因爲我總是得到錯誤中遇到的問題「Request format is unrecognized for URL unexpectedly ending in '/GetBranches'
」無法識別的網址.getJSON
這裏是我的代碼:
$.getJSON('testWS.asmx/GetBranches', function (data, status, xhr) {
console.log(data);
});
下面是web service
[WebMethod]
[ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
public List<BranchesModel> GetBranches()
{
return BranchesBLL.Instance.GetBranches();
}
我的網址有什麼問題?我怎樣才能解決這個問題,以便我可以使用$ .getJSON函數?
試着用小的情況下數據類型: 'JSON' – Miller
一個是'GET'另一個是'POST' – Deadlock