Created
June 21, 2016 14:09
-
-
Save shlomitc/4b8dbe98a7271d2ffc2738b2efc32175 to your computer and use it in GitHub Desktop.
How to use the fetch api to send a json object
This file contains hidden or 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
fetch('http://localhost:4000/generate', | |
{ | |
method: "POST", | |
headers: { | |
"Content-type": "application/json; charset=UTF-8" | |
}, | |
body: JSON.stringify({a:1}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment