Access-Control-Allow-Methods: OPTIONS & CORS


Access-Control-Allow-Methods: OPTIONS

CORS

https://stackoverflow.com/questions/20478312/default-value-for-access-control-allow-methods
https://www.html5rocks.com/en/tutorials/cors/

https://www.w3.org/TR/cors/#preflight-request

https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Methods

Comma-delimited list of the allowed HTTP request methods.


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

https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods
https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/OPTIONS
https://fetch.spec.whatwg.org/#http-access-control-allow-methods

https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Preflighted_requests

image
image

demo


var invocation = new XMLHttpRequest();
var url = 'http://bar.other/resources/post-here/';
var body = '<?xml version="1.0"?><person><name>Arun</name></person>';
    
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); 
    }
}

// ......


Flag Counter

&copyxgqfrms 2012-2020

www.cnblogs.com 發布文章使用:只允許注冊用戶才可以訪問!



免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM