HTTP Methods GET POST PUT PATCH DELETE | SoftwaretestingbyMKT

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi guys welcome to the channel so as a part of this video i'm going to talk about http methods and this video is going to be my fifth video on the playlist api that is application programming interface so this http that is hyper text transfer protocol is designed to enable communication between client and the server example when you are using any application from your chrome browser that time your client will be your google chrome and your server will be the application that you're trying to access for example you know that when any application is not developed you will access the application using api and you will access the api using postman as a tool that time your postman is a client and your server is the application if you take an example of any application that you are accessing you are basically performing four functions that is create read update or delete so this is a crude functionalities that you perform in any of the application you either create you either read you either update or you either delete something so to perform this crude functionality we have an http methods so that is your get method your post method your put method your patch method and delete method your get method is used to read the data your post method is used to create the data your put and patch http method is used to update the data and your delete http method is used to delete the data example you are browsing something you are just trying to read the data so so now we know that get http method is used to read the data so anywhere in the website if you're just reading something or if you're just retrieving the data that is called as get method from the get method you just read the data if any in any application if you try to create something so if let's take an example you have selected some application and you're trying to create your profile you're trying to create your profile by adding your mobile number your first name and last name you're trying to create the user that is done using your post http method and now since you have created your profile now you want to update your mobile number that is done using either by put or patch more about put and patch i will be talking deeply later for now you just understand that if i want to update any data anywhere i use either put or patch now you are using some application and now you don't like the application you want to come out of that application and you finally want to delete your profile from that application that thing can be done using deed http methods so in this video i'm going to talk about your get http method your post put patch and deed http methods only because these are the famous http methods these http methods are widely used in most of the 99.9 percent of the companies we have multiple http methods we actually have multiple http methods but i'm not going deeper into those http methods but i'm only going to talk about these five http methods that is get post put patch and delete so let's get started [Music] each api request uses a http method in postman you can make any api request and get the response without writing any single code so when you write your request and click on the send button you get the response and that will be visible to you with your eyes within postman user interface so postman user interface allows you to see the response that my request have given and that you can examine for your understanding that that response you can verify to proceed further now let's talk about get http method so using get http method it is used to retrieve that data your get http method used to get the data using the your url in url you will mention all the data that is required to get the response using your http request it will not have any impact on the resource but using your get request it will only give you the data that you are looking for and to get the data you need to modify your request in such a way that you need to mention all the parameters that you are looking for example if you are trying to book a hotel you need to particularly search with those parameters like which date you are willing to travel and which city you are traveling how much is the price range you want to search the hotel all those things you need to mention in your particular request url in order to get the response from the server this is the main method used in order to get the document retrieval so in simple word your get method is used to retrieve the data whatever information is specified in your url it will give you all the data that you are looking for that you have already shown in your url so this is all about get method now let's talk about post method your post http method is used to send data to the server using post http method you create something for example you take an example of any application that you are trying to download from your google store once you download the application you try to create your user right you try to create your user by giving your username your last name your mobile number you're trying to create a user anything that you're trying to create something that can be done using your post http method post http method is only used to create something for an example if you are using a facebook application you try to update your profile or example if you try to upload any photo of yours that comes under that is done using your post http method and also if you are using any application where you are doing the registration that comes under your post http method and once you have created something that will be stored in the db of the application you are accessing so this is all about your post method now let's move to the put http methods your put http method is used to update the data your put http method replaces all current representation of the target resource with the uploaded content for an example if you are using any application so using put request you are trying to update the data that you have already created so once something is created using post http method now you can use put to update some data and the main difference between post and put is that your put http method is identified that means calling put http methods multiple times will not have any impact on the data that you have already uploaded or the data that you have already updated or the reason put http methods are called as item patent is because once you have updated something even though you are trying to click on the send button even hundred times or thousand times it will not create multiple data again and again but it will only overwrite the data that is already created unlike your post http method where if you are sending the same data again and again it will create multiple users each and every time you click on the send button but put is identity on the other hand where even though you click or even though you click on the send button thousand times or maybe two times it will not going to create something it is only going to give the same result on a very easy language if i say you put request even though you call it multiple times it will give you the same data on the other hand your post request if you send the post request multiple times it will give you other data again and again post request if you are calling it multiple times it will always create the new data again and again maybe multiple times how much ever time you are sending the data using post http method it will create the new data multiple times if you want to update a particular resource using put http method in your body you need to pass the whole parameters that you are trying to change that you are trying to update using your put http method you need to send the entire request or entire set of data to update it with the help of which your entire response will get changed using put http method your request body should contain the complete new version of the data that you are trying to update and now how your put is different from your patch i will be talking when i am talking about patch http methods now let's go ahead to talk about delete http method as i said you using delete http method you are trying to delete something anything which you have mentioned in the url let's take an example if you have downloaded some application and now you no longer wants to be into that application and you want to delete your profile in that case you will call delete http method you will provide the resource uri that is you provide all the detail that you want to delete which user you want to delete and then it will delete your profile from in that whatever the target resource you have given it will delete that now let's talk about patch http methods your path http methods have the capabilities to modify the data your patch http method is very much similar to the put http method but how it is different is using put http method you send the entire data entire new version of the data that you want to update but using your patch http method since as the name suggests patch which we already we have already learned in the software testing what is the meaning of patch so in the patch you don't send the whole data that you want to upload that you want to update but you only send the specific data that you want to update let's take an example if you have created a user with the name of manish and mobile number something so using a put you can update your first name and mobile number so your put is used to change the entire data that you have created but using patch now let's take an example my user is created as manish he has a role number one so that role number one i can mention in my url so that my ur my my url will tell me that which user i should go and update and in the body i will not pass my whole full name and my mobile number but i will only pass my mobile number i don't want to update my first name but i only want to update my mobile number so in that case where i want to update only a particular thing but not the whole thing i will use patch so guys that's all from this video i hope this video was useful if years please give a big thumbs up this video subscribe to my channel software testing by mkd and please share this video with only friends in case you have any kind of doubt or taught all your doubt in the comment section you can reach to me out on quora my two track on my instagram account any account my gmail account all the accounts i have mentioned in my link description please check it out in my next video i'm going to show you practically how post put patch delete and get http method really works so that's all from this video thank you so much [Music] you
Info
Channel: SoftwaretestingbyMKT
Views: 41,553
Rating: 4.9165702 out of 5
Keywords: softwaretestingbymkt, software testing, http, https, http methods, http methods in rest api, http meaning, api testing, api, HTTP Basics, http tutorial, server, http status, request response, Hypertext Transfer Protocol (Internet Protocol), http methods tutorial, get method, post method, put method, patch method, delete method, idempotent methods, api testing tutorial, api testing tutorials, REST API - HTTP Request Methods, patch vs put http method, put vs patch http method
Id: IngegJwpMoQ
Channel Id: undefined
Length: 12min 27sec (747 seconds)
Published: Fri Oct 09 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.