Instantly share code, notes, and snippets.

Embed
What would you like to do?
setPluginUrl() {
// Deleting the default header
delete window.axios.defaults.headers.common['X-CSRF-TOKEN'];
// Calling the method that fetches the data from Github
this.fetchUrl().then(data => {
this.pluginUrl = data;
});
// Reset the axios default headers
window.axios.defaults.headers.common = {
'X-Requested-With': 'XMLHttpRequest',
'X-CSRF-TOKEN': Spark.csrfToken
};
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment