108. URL Parameters & Delete Requests
Week 3: Day 2 Section 12: Intro to Node, Mongo, & REST APIs Tutorial 108: URL Parameters & Delete Requests In this tutorial video, we are going to learn about POST requests and how to send POST requests using the POSTMAN tool. POST is an HTTP method used to send data to a server to create or update a resource. The data sent to the server with POST request is stored in the request body of the HTTP. What is the POST request? It is a request method supported by HTTP(Hypertext Transfer Protocol). It is used when we need to send some additional information inside the body of the request to the server. The main purpose of sending the POST request is to have some modifications at the server such as updating, deletion, or addition. It is never cached and doesn't remain in the browser history. It cannot be bookmarked. It has no restrictions on data length. One of the classical examples of the POST requests is the login page. When you sign up for anything, let's say Instagram, you send your personal information such as a password to the server. The server creates a new account with the same details and that account is added permanently on the Instagram server. What is POSTMAN? POSTMAN is a tool used when you are trying to dissect restful APIs made by others or test ones you have made yourself. It offers a sleek interface with which you can test an APIs functionality without writing a bunch of codes. POST request in POSTMAN: Steps to follow while sending a POST request using POSTMAN are as follows: 1. Without the body Change the type of method from GET to POST and click the SEND button. Now in the response section, you will see ' invalid post data'. It is because we have not added any information in the request body. 2. Select the BODY tab, to add body to the POST request. 3. Select the data type( RAW, FORM FORMAT,etc.) and select the format( JSON, HTML, TEXT) type from the drop-down menu of the BODY tag. It is done because we need to send the request inappropriate format that the server accepts. 4. Enter the data in the request body and press SEND and see the response body and response status. SENDING BODY DATA: As we need to send body data with requests whenever you need to add or update structured data, Select the POST request method and go to the BODY option where we get different options for sending data. They are as follows: 1. None 2. Form format- Used for sending the information you enter while filling out a form 3. X-www-form-urlencoded - It works similarly to Form format but the only difference is in this case, the URL is encoded. Encoding prevents unauthorized persons from recognizing the data. 4. Raw- The body data is presented in the form of a stream of bits. 5. Binary- It is used to send the data in a separate format such as a file, image, etc. To use this option, select Binary and then click on the select file to browse any file from your system. 6. GraphQL- It is used to send the GraphQL queries. You need to enter the code in the section of QUERY and any variable in the section of GRAPHQL VARIABLES. Full Stack Web Development in Just 3 weeks Published by WB Web, Under free promotions, Watch All the videos for free for limited time. You can buy the course from Udemy for a lifetime access. Udemy Course Link: https://www.udemy.com/ultimate-web/ Content Credit: Mark Price https://www.devslopes.com/ Hosted By WB Web Development Solutions
Download
0 formatsNo download links available.