2
我想POST HTML表單到web-api。跨域ajax POST到web-api始終返回空響應
如果我在其他域中使用jQuery執行ajax POST,一切正常,我收到200 OK ,但在螢火蟲和響應選項卡中收到我收到類似下圖的空白響應。 這是我的jQuery代碼:
var formData = new FormData($('form')[0]);
var response = '';
$.ajax({
url: 'http://localhost:2143/api/controller',
type: 'POST',
// Form data
data: formData,
//Options to tell JQuery not to process data or worry about content-type
cache: false,
contentType: false,
processData: false,
success : function(text)
{
response = text;
alert(response);
}
});
請幫我...