Skip to content

Instantly share code, notes, and snippets.

@mogwai
Created March 9, 2018 12:07
Show Gist options
  • Save mogwai/a6db5cff290ff75cb08d27e0393fc2f3 to your computer and use it in GitHub Desktop.
Save mogwai/a6db5cff290ff75cb08d27e0393fc2f3 to your computer and use it in GitHub Desktop.
Sending a HTTPS Request
const request = require('request')
const url = "https://sad-poincare-i76vm5gt.vertuozpilot.engie.fr/hemis/rest/WS_UserManagement/login"
const options = {
url: url,
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"Cache-Control": "no-cache",
"Postman-Token": "314a0757-450b-7889-8c2f-9ca33b3c72a5"
},
formData: {
'email': '[email protected]',
'password': '4a9f85d4-0acf-4d3b-b282-87b2330925ee'
}
};
request.post(options, (err, res, bod) => {
console.log(JSON.parse(bod))
console.log(err)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment