Using curl  to send JSON data to an API.   Below is a very simple command to send JSON data to your API.  curl -H "Content-Type: application/json" -d '{"firstname":"ahmed","lastname":"zzzz"}' http://localhost:3000/login   Above command will send a JSON as below to link http://localhost:3000/login   {     "firstname":"ahmed",     "lastname":"zzzz" }