Skip to content

Instantly share code, notes, and snippets.

@benhowdle89
Created August 14, 2015 12:17
Show Gist options
  • Save benhowdle89/f8dd321a47dbb564aee3 to your computer and use it in GitHub Desktop.
Save benhowdle89/f8dd321a47dbb564aee3 to your computer and use it in GitHub Desktop.
var h = new Headers()
h.append('Authorization', 'Bearer xxx');
h.append('Cookie', 'xxx');
h.append('Content-Type', 'application/json');
fetch('http://localhost:4567/api/reviews', {
headers: h,
method: 'POST',
body: JSON.stringify({ "foo": "bar" })
}).then(function (res) {
return res.json().then(function (json) {
console.log(json)
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment