node_rest_api_mongo
node_rest_api_mongo copied to clipboard
user is not defined
While I am trying to create a new user using Postman ['http://192.168.1.106:3000/v1/users' using POST method, data -> {"unique_key" : "John", "email" : "[email protected]", "phone" : "7887566", "password" : "qwer1234"} as application/json], i am unable to get the user posted onto the db (I added additional line as console.log (user)).
If I use following curl command curl -X POST -H "Content-Type: application/json" -d '{"unique_key":"john","email":"[email protected]","phone":"7777887566","password":"qwer1234"}' http://192.168.1.106:3000/v1/users
I get "A valid email or phone number was not entered" (after removing the console.log(user))
If you want to create new user you should do not add key unique_key ? ok now i try a example to help you: '{"email":"[email protected]","phone":"7777887566","password":"qwer1234"}'