Skip to content

Instantly share code, notes, and snippets.

@goodviber
Created June 10, 2018 23:33
Show Gist options
  • Save goodviber/3e1ef9eb71139fdf2b30be2f427ef4a3 to your computer and use it in GitHub Desktop.
Save goodviber/3e1ef9eb71139fdf2b30be2f427ef4a3 to your computer and use it in GitHub Desktop.
fetch with rack cors
fetch(url,
{
method: 'PUT',
headers: {'Content-Type': 'application/json',
'Accept': 'application/json',
'X-Requested-With': 'XMLHttpRequest',
'X-CSRF-Token': token},
body: JSON.stringify({
"od" : {
"picker_id" : pickerId,
}
}),
credentials: 'same-origin'
})
.then(this.checkStatus).....etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment