Setting up Post request to create a todo

To create the POST request, if you recall, we have to change the method to POST and the URL will be the same, localhost:3000/todos:

Now, in order for this request to succeed, we also have to pass along a Body tab. This one is going to be a raw JSON body. Here, we can specify the data we'd like to send. In this case, the only data property we're going to send is text, and I'll set this to Something to do from postman:

{ 
  "text": "Something to do from postman"
}

Now, we can go ahead and fire this off, and down below we get our newly created Todo with a 200 status code:

Which means everything went well. ...

Get Advanced Node.js Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.