博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Access-Control-Allow-Methods: OPTIONS & CORS
阅读量:4689 次
发布时间:2019-06-09

本文共 655 字,大约阅读时间需要 2 分钟。

Access-Control-Allow-Methods: OPTIONS

CORS

Comma-delimited list of the allowed HTTP request methods.

Access-Control-Allow-Methods: POST, GET, OPTIONS

image

image

demo

var invocation = new XMLHttpRequest();var url = 'http://bar.other/resources/post-here/';var body = '
Arun
'; function callOtherDomain(){ if(invocation) { invocation.open('POST', url, true); invocation.setRequestHeader('X-PINGOTHER', 'pingpong'); invocation.setRequestHeader('Content-Type', 'application/xml'); invocation.onreadystatechange = handler; invocation.send(body); }}// ......

740516-20181121112214103-114985883.png

转载于:https://www.cnblogs.com/xgqfrms/p/9993892.html

你可能感兴趣的文章