Skip to content

Instantly share code, notes, and snippets.

@talut
Created September 6, 2017 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save talut/0f4fe479e440e7f2dac899e89d1ca866 to your computer and use it in GitHub Desktop.
Save talut/0f4fe479e440e7f2dac899e89d1ca866 to your computer and use it in GitHub Desktop.
Node-fetch Post (for golang rest-api)
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