CORS

var apiBase = 'https://api.okdevtest.net';

function get() {
  var xhr = new XMLHttpRequest();
  xhr.addEventListener('load', reqListener);
  xhr.open('GET', `${apiBase}/ajax/server`, true);
  xhr.withCredentials = true;
  xhr.send(null);
}

preflight

function preflight() {
var xhr = new XMLHttpRequest();
xhr.addEventListener('load', reqListener);
xhr.open('GET', `${apiBase}/ajax/server`, true);
xhr.withCredentials = true;
xhr.setRequestHeader('Ping-Other', 'pingpong');
xhr.setRequestHeader('Content-Type', 'application/xml');
xhr.send(null);
}
OPTIONS Time: 2020-05-27T16:43:20.416Z
POST Time: 2020-05-27T16:43:20.544Z
host, x-real-ip, x-forwarded-for, x-forwarded-proto, connection, accept, origin, sec-fetch-mode, sec-fetch-site, sec-fetch-dest, referer, user-agent, accept-encoding, accept-language
host, x-real-ip, x-forwarded-for, x-forwarded-proto, connection, accept, origin, sec-fetch-site, sec-fetch-mode, sec-fetch-dest, referer, user-agent, accept-encoding, accept-language

OPTIONS: access-control-request-method, access-control-request-headers,
POST:    content-length, ping-other, content-type, cookie
mobile crosssite

ref

What Else?
inflearn react api server -50% 할인쿠폰: 15108-f2af1e086101 buy me a coffee