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

Access-Control-Allow-Methods: OPTIONS & CORS
Access-Control-Allow-Methods: OPTIONS & CORS

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); 
    }
}

// ......

Access-Control-Allow-Methods: OPTIONS & CORS


Access-Control-Allow-Methods: OPTIONS & CORS

©xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-07
  • 2017-12-15
  • 2022-12-23
  • 2022-12-23
  • 2021-08-26
猜你喜欢
  • 2022-12-23
  • 2021-07-27
  • 2021-05-22
  • 2018-12-17
  • 2021-09-29
  • 2021-08-18
相关资源
相似解决方案