Last active
September 2, 2020 08:16
-
-
Save tzafrirben/4b30e758506c578fb5974e82a7fdebdf to your computer and use it in GitHub Desktop.
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
const newUser = { | |
userName: "[email protected]", | |
firstName: "John", | |
lastName: "Doe", | |
... | |
}; | |
const request = require('request'); | |
const options = { | |
method: 'POST', | |
url: 'http://localhost:3000/v1/users', | |
headers: { | |
'Content-Type': 'application/json' | |
}, | |
body: JSON.stringify(newUser) | |
}; | |
request(options, function (error, response) { | |
if (error) throw new Error(error); | |
console.log(response.body); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment