node_rest_api_mongo icon indicating copy to clipboard operation
node_rest_api_mongo copied to clipboard

user is not defined

Open anilprasad opened this issue 7 years ago • 1 comments

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))

anilprasad avatar May 23 '18 15:05 anilprasad

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"}'

helloo0-0oword avatar Jun 12 '18 16:06 helloo0-0oword