Created
August 14, 2015 12:17
-
-
Save benhowdle89/f8dd321a47dbb564aee3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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