Skip to content

Instantly share code, notes, and snippets.

@alvnrapada
Last active August 19, 2020 10:31
Show Gist options
  • Save alvnrapada/ac81b2b3ef23029de257600cd3d25a69 to your computer and use it in GitHub Desktop.
Save alvnrapada/ac81b2b3ef23029de257600cd3d25a69 to your computer and use it in GitHub Desktop.
_initRequest() {
const xhr = this.xhr = new XMLHttpRequest();
xhr.open('POST', this.url, true);
xhr.responseType = 'json';
xhr.setRequestHeader('Access-Control-Allow-Origin', '*')
xhr.setRequestHeader('Authorization', 'YOUR_TOKEN')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment