POST method endpoints

The POST method is typically used when we want to insert new data into our database.

POST /post. For this endpoint, we need to use Postman to be able to send the data through the body. To do this, you need to select the POST method in Postman. Use the URL http://localhost:3000/api/post, then click on Headers, and you need to add the header Content-Type with the value application/x-www-form-urlencoded:

After you set the header, then go to the Body tab and select the raw option, and you can send the information like this:

Now you can hit the Send button and see the response that the service returns:

If you did everything ...

Get React Cookbook 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.