我需要用内容类型为'application/json'的jsonp POST请求。我可以通过以下方式将POST请求发送到服务器:
jQuery.ajax({
type: 'POST',
url: url,
data: data,
success: success,
error: error,
async: true,
complete: complete,
timeout: TIMEOUT,
scriptCharset: 'UTF-8',
dataType: 'jsonp',
jsonp: '_jsonp',
});
但是,当我添加以下行:contentType: "application/json"
时,它开始将其作为OPTIONS请求发送,而不是POST请求。
我如何指定内容类型并仍将请求提交为POST?