我有期待一個POST WCF服務。使用Fiddler我發現在跨域的情況下,我的POST請求變成了GET,導致服務器發生錯誤405。JQuery的阿賈克斯JSONP POST改爲GET當跨域
$.ajax({
type: "POST",
url: "http://blah/blah.svc/Test",
data: JSON.stringify("{ 'WebUserID': 4 }"),
dataType: "jsonp", // from server
contentType: "application/json; charset=utf-8", // to server
success: function (data, status, xhr) {
alert("success--");
}
});
任何人都可以對此有所瞭解嗎?
感謝
這不是真的重複,但答案回答了這個問題:http://stackoverflow.com/questions/2699277/post-data-to-jsonp – lonesomeday