Created
May 7, 2017 10:10
-
-
Save 7rin0/59ed82acac5f31752f3e473d32f71e24 to your computer and use it in GitHub Desktop.
Node.js simple and custom post request
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
// http://stackoverflow.com/a/6432824 | |
var request = require('request'); | |
request.post({ | |
headers: {'content-type' : 'application/x-www-form-urlencoded'}, | |
url: 'http://localhost/test2.php', | |
body: "mes=heydude" | |
}, function(error, response, body){ | |
console.log(body); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment