Wie erstelle ich eine jsonp-POST-Anforderung, die contentType mit jQuery angibt?
Ich muss eine jsonp-POST-Anforderung mit dem Inhaltstyp "application / json" durchführen. Ich kann die POST-Anfrage wie folgt an den Server senden:
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',
});
Aber sobald ich die Zeile hinzufüge:contentType: "application/json"
Es wird als OPTIONS-Anforderung und nicht als POST gesendet.
Wie kann ich den Inhaltstyp angeben und die Anforderung dennoch als POST senden?