Making HTTP POST requests with Postman
Now, we will use the Builder tab in Postman to compose and send an HTTP POST request to create a new toy. Perform the following steps:
- Click on the plus (+) button on the right-hand side of the tab that displayed the previous request. This way, you will create a new tab.
- Select
Requestin the New drop-down menu located in the upper-left corner. - Select
POSTin the drop-down menu on the left-hand side of theEnter request URLtextbox.
Â
- Enter
localhost:8000/toys/in that textbox on the right-hand side of the drop-down menu. - Click
Bodyon the right-hand side ofAuthorizationandHeaders, within the panel that composes the request. - Activate the
rawradio button and selectJSON (application/json)in the drop-down menu on the right-hand side of thebinaryradio button. Postman will automatically add aContent-type = application/jsonheader, and therefore, you will notice theHeaderstab will be renamed toHeaders (1), indicating to us that there is one key-value...