Created
September 6, 2017 14:21
-
-
Save talut/0f4fe479e440e7f2dac899e89d1ca866 to your computer and use it in GitHub Desktop.
Node-fetch Post (for golang rest-api)
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
const FormData = require('form-data'); | |
const data = new FormData(); | |
data.append('email', "demo@demo.com"); | |
data.append('password', "demo123"); | |
fetch('http://localhost:5656/', { method: 'POST', body: data }) | |
.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