Postman Beginner Tutorial 4 | PUT PATCH API Request

  Рет қаралды 100,879

Automation Step by Step

Automation Step by Step

Күн бұрын

Пікірлер
@aylinbekem3701
@aylinbekem3701 2 жыл бұрын
Raghav , Can you imagine how many students have been inspired by you ? I like the way your video ends with Never stop leaning ! Thank you for your hard work
@RaghavPal
@RaghavPal 2 жыл бұрын
So nice of you Aylin
@akhil100
@akhil100 2 жыл бұрын
Aylin I think you meant "inspired" and not "expired". :)
@aylinbekem3701
@aylinbekem3701 2 жыл бұрын
@@akhil100 You are right . I just corrected
@nischalkoirala7064
@nischalkoirala7064 9 күн бұрын
@@aylinbekem3701 expired lol
@AnjuliKhare
@AnjuliKhare 2 жыл бұрын
Hello Sir..Thank You So much for sharing video on postman. But plz share next video early so we can go fast .. thank you.
@RaghavPal
@RaghavPal 2 жыл бұрын
I will try Anjuli
@marcioardanuy3089
@marcioardanuy3089 10 ай бұрын
Amazing tutorial. Greetings from Brazil!!
@RaghavPal
@RaghavPal 10 ай бұрын
Glad you liked it Marcio
@fidawani7200
@fidawani7200 Жыл бұрын
Jio bhai Great explanation 😊
@RaghavPal
@RaghavPal Жыл бұрын
Thanks a lot
@prasadchavakula8451
@prasadchavakula8451 Жыл бұрын
Nice video, now understood the importance between post and put Thanks Raghav
@RaghavPal
@RaghavPal Жыл бұрын
Glad it was helpful Prasad
@gayatritankar7856
@gayatritankar7856 Жыл бұрын
Hello, Sir thank you so much for sharing these videos, it will be really helpful for us.
@RaghavPal
@RaghavPal Жыл бұрын
So nice of you Gayatri
@GamingUnlocking
@GamingUnlocking 2 жыл бұрын
Great explanation with user friendly tools👍
@RaghavPal
@RaghavPal 2 жыл бұрын
Glad it was helpful Sonu
@jatingirdhar1589
@jatingirdhar1589 10 ай бұрын
Thanks for the awesome video, Raghav sir ! However I could not understand exactly here what is the difference b/w PUT & PATCH bcoz I am able to change the data partially with PATCH too...I believe it would be clarified in next videos...The way you explain is just awesome....Hats off to you !
@RaghavPal
@RaghavPal 10 ай бұрын
I will add more on this Jatin... keep watching
@prernasharma1307
@prernasharma1307 2 жыл бұрын
Hi Raghav, if I want to update partially.... PUT works in that case too so could you pls elaborate more on the difference between patch n put with examples
@RaghavPal
@RaghavPal 2 жыл бұрын
Hi Prerna, sure I will add a video on this, I recently created a community post for it, Can find it here - kzbin.info/door/Tt7pyY-o0eltq14glaG5dgcommunity
@prernasharma1307
@prernasharma1307 2 жыл бұрын
@@RaghavPal thanks Raghav... Will check
@mohammadhabib8334
@mohammadhabib8334 2 жыл бұрын
Thank you Raghav 😊
@RaghavPal
@RaghavPal 2 жыл бұрын
So nice of you
@mv8167
@mv8167 Жыл бұрын
Could you please tell me how you got to the Rest Request at time 1:16, showing the resources we can use?
@RaghavPal
@RaghavPal Жыл бұрын
Hi Mike, it is a demo rest service available here - thomas-bayer.com/sqlrest
@revolver_84
@revolver_84 2 жыл бұрын
Very clear and at a good pace video. Well done.
@RaghavPal
@RaghavPal 2 жыл бұрын
Thanks a lot
@kuklosmissingeye9609
@kuklosmissingeye9609 2 жыл бұрын
Saved me brother! Thank you :D
@RaghavPal
@RaghavPal 2 жыл бұрын
Most welcome
@amarnath1494
@amarnath1494 Жыл бұрын
Hi Raghav, Thanks for posting the video. Can you give more clarity b'n Put and Patch requests?
@RaghavPal
@RaghavPal Жыл бұрын
Amarnath The PUT and PATCH HTTP methods are both used to update resources, but they differ in how they do it. *PUT* sends the entire resource to the server, replacing the existing resource with the new one. *PATCH* sends a partial representation of the resource to the server, which is then used to update the existing resource. So PUT replaces the resource PATCH updates the resource (partially or completely) *Which method to use depends on the specific needs of your application.* If you need to update the entire resource, then you should use PUT. If you only need to update a portion of the resource, then you should use PATCH. *Here are some general guidelines for choosing between PUT and PATCH:* * Use PUT if you need to update the entire resource. * Use PATCH if you only need to update a portion of the resource. * Use PUT if you want to ensure that the resource is in a consistent state after the update. * Use PATCH if you want to allow the client to update the resource without having to know the entire state of the resource.
@LakshmiGaneshGupthaBachu
@LakshmiGaneshGupthaBachu 11 ай бұрын
Good Explanation bro
@RaghavPal
@RaghavPal 11 ай бұрын
Thanks a lot Lakshmi
@learnitrussian
@learnitrussian 4 ай бұрын
Thanks a lot! Just a quick question, why after a successful update I ask for information about this user by /api/users/2 I see the old name?
@RaghavPal
@RaghavPal 4 ай бұрын
these are dummy APIs and they do not change anything at the backend
@mubashar-nouman
@mubashar-nouman Жыл бұрын
Which tool you are using for highlighting something on screen? Like during video you highlight some sections with red bordered triangle etc
@RaghavPal
@RaghavPal Жыл бұрын
It's screen annotation tools
@Tamanbir
@Tamanbir 2 жыл бұрын
What about updating an index of array? I get out of bound exception if i go as per docs
@RaghavPal
@RaghavPal 2 жыл бұрын
will need to check the scripts and logs
@kalpanabadri27
@kalpanabadri27 Жыл бұрын
Hi raghav, i have doubt first i performed get operation to get all users(have first name is kalpana and id is 1) after i performed put operation that body has first name is rakesh who have id is 1.Next time i performed get operation that firstname will be updated or not who have id=1 ??
@RaghavPal
@RaghavPal Жыл бұрын
Kalpana Yes, if you perform a GET operation to get all users with the first name "Kalpana" and ID 1, and then perform a PUT operation to update the first name of the user with ID 1 to "Rakesh", the next time you perform a GET operation, the first name of the user with ID 1 will be "Rakesh". This is because the PUT operation updates the data on the server, and the GET operation retrieves the updated data from the server. Here's a more detailed explanation of how these operations work: **GET Operation:** The GET operation is used to retrieve data from a server. When you perform a GET operation, the server sends you back the current state of the data. In this case, you are performing a GET operation to retrieve all users with the first name "Kalpana" and ID 1. The server will send you back a JSON object with the following data: ```json { "id": 1, "firstName": "Kalpana" } ``` **PUT Operation:** The PUT operation is used to update data on a server. When you perform a PUT operation, you send the server a JSON object with the new data. In this case, you are performing a PUT operation to update the first name of the user with ID 1 to "Rakesh". The server will update the data on its end, and then send you back a JSON object with the following data: ```json { "id": 1, "firstName": "Rakesh" } ``` **Subsequent GET Operations:** The next time you perform a GET operation to retrieve all users with the first name "Kalpana" and ID 1, the server will send you back the JSON object with the updated data: ```json { "id": 1, "firstName": "Rakesh" } ``` This is because the PUT operation updated the data on the server, and the GET operation is retrieving the updated data from the server.
@persistent-s
@persistent-s Жыл бұрын
Thanks for the video, sir. But couldn't get any difference between PUT and PATCH!
@RaghavPal
@RaghavPal Жыл бұрын
Hi Yash, Sure, I can explain the difference between PUT and PATCH in easy language with an example! Imagine you have a toy car that you want to customize. You can change its color, add stickers, or modify its shape. In the context of web development, PUT and PATCH are two methods that are used to modify resources on a web server. PUT is like replacing the entire toy car with a new one. If you use PUT to modify a resource, you must send the complete representation of that resource to the server. This means that if you want to change a single attribute of the resource, you need to send the entire resource with the new attribute value. For example, if you have a toy car resource with attributes like "color," "sticker," and "shape," and you want to change the color of the car, you would need to send the entire toy car resource with the new color attribute value using the PUT method. On the other hand, PATCH is like modifying the toy car piece by piece. With PATCH, you can modify specific attributes of a resource without sending the entire representation of that resource to the server. This makes PATCH more efficient than PUT for making small changes. For example, if you want to change only the color of the toy car using the PATCH method, you can send a request to the server with just the new color attribute value, without including the entire toy car resource. In summary, PUT is used to completely replace a resource, while PATCH is used to make partial modifications to a resource
@javedislam5921
@javedislam5921 Жыл бұрын
I am using postman to test my rest api PUT request against the app created on STS 4 spring boot framework. I am getting this error: Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: No acceptable representation] client content type raw JSON. I understand that once the client and server are both using compatible media types, the HttpMediaTypeNotAcceptableException should no longer occur and the response should be returned successfully. How do I fix it? Thanks
@RaghavPal
@RaghavPal Жыл бұрын
Hi Javed, The error you're seeing (HttpMediaTypeNotAcceptableException) typically occurs when the server is unable to provide a response in a format that the client can accept. This means that the client and server are not using compatible media types, as you correctly noted. To fix this error, you'll need to ensure that the client and server are both using compatible media types. Here are a few steps you can take to troubleshoot and resolve this issue: Check the request headers: In your Postman request, make sure that the Content-Type header is set to application/json. This tells the server that the request body is in JSON format. Check the response headers: In the server response, make sure that the Content-Type header is set to a format that the client can accept. If the client is expecting JSON, the Content-Type header should be set to application/json. You can set this header in your Spring Boot application by adding the produces attribute to your @RequestMapping annotation, like this: @RequestMapping(value = "/your-endpoint", method = RequestMethod.PUT, produces = "application/json") Check the response body: Make sure that the response body is actually in the format specified by the Content-Type header. If the Content-Type header is set to application/json, the response body should be a valid JSON string. Check the server logs: If the above steps don't help, check the logs of your Spring Boot application to see if there are any additional error messages that might help you diagnose the problem. By following these steps, you should be able to identify and fix the issue causing the HttpMediaTypeNotAcceptableException error.
@moviekazi1536
@moviekazi1536 Жыл бұрын
But the PATCH method also changed the whole object in your example. Shouldn't there still be job in the result in patch method?
@RaghavPal
@RaghavPal Жыл бұрын
This may be the case as these are dummy APIs we are using for demo
@chinmayk2657
@chinmayk2657 Жыл бұрын
Authentication token need to pass as cookie. Cookie name is “token” and value is generated auth token. ‘Cookie: token=’. HOW TO DO THIS - STEPS
@RaghavPal
@RaghavPal Жыл бұрын
Hi Chinmay Sure, here are the steps on how to pass an authentication token as a cookie in Postman: 1. Open the Postman app and create a new request. 2. In the Request tab, enter the URL of the API that you want to authenticate with. 3. In the Headers tab, click on the **Cookies** tab. 4. Click on the **Add Cookie** button. 5. In the **Name** field, enter the name of the cookie, which is "token" in this case. 6. In the **Value** field, enter the value of the cookie, which is the generated auth token. 7. Click on the **Save** button. 8. Click on the **Send** button to send the request. The API should now be authenticated with the generated auth token. Here are some additional tips for passing authentication tokens as cookies in Postman: * You can also use the **Authorization** tab to pass authentication tokens. The **Authorization** tab allows you to select different types of authentication, such as Basic Auth, Bearer Auth, and OAuth. * You can use the **Variables** feature in Postman to store authentication tokens. This can be useful if you need to use the same authentication token for multiple requests. * You can use the **Collection Runner** feature in Postman to run a collection of requests that all use the same authentication token. This can be useful for automating tasks that require authentication
@justinecasiong9147
@justinecasiong9147 2 жыл бұрын
thank you sir!
@RaghavPal
@RaghavPal 2 жыл бұрын
Most welcome Justine
@dantegutierrezsantos9367
@dantegutierrezsantos9367 2 жыл бұрын
Hi Raghav, what if I want to use PATCH on an API but I don't know the record ID but I already know the user_name for example? How can I apply the PATCH command in this example? Thanks.
@RaghavPal
@RaghavPal 2 жыл бұрын
Hi Dante, It will depend on your APIs, basically for a PATCH we need to point to the exact resource, whatever way you can in an API, whether it is through any unique value, like ID, Name or some combination
@itsme-vc8fs
@itsme-vc8fs 2 жыл бұрын
Sir, when i tried to do the put in the exact way you do, in repose, i could see only "updated at..." Why iam not getting name amd job? Please help
@RaghavPal
@RaghavPal 2 жыл бұрын
its demo sample APIs, may have changed
@ammarsadeq6078
@ammarsadeq6078 11 ай бұрын
Is there no test to do at the end?
@RaghavPal
@RaghavPal 11 ай бұрын
Ammar Have covered Tests in a separate session.
@victoriduh3130
@victoriduh3130 2 жыл бұрын
Please if I want to use patch request on all data in the api how do I do it?
@RaghavPal
@RaghavPal 2 жыл бұрын
will need to see some example Victor
@vipintekade6400
@vipintekade6400 2 жыл бұрын
Please add video including HEAD ,TRACE AND OPTION METHOD.
@RaghavPal
@RaghavPal 2 жыл бұрын
Sure Vipin, will plan to add
@vipintekade6400
@vipintekade6400 2 жыл бұрын
With practical examples.
@RaghavPal
@RaghavPal 2 жыл бұрын
ok
@sivaporeddy72
@sivaporeddy72 2 жыл бұрын
What happens if we use PATCH to update both name and Job. Is that not similar to PUT?
@RaghavPal
@RaghavPal 2 жыл бұрын
Hi Siva, Patch - update some information of the resource Put - replace the resource
@asimameer3445
@asimameer3445 2 жыл бұрын
Is this course for API testing or developing the API?
@RaghavPal
@RaghavPal 2 жыл бұрын
Testing API
@muneeburrehman2280
@muneeburrehman2280 2 жыл бұрын
Hello sir. I am getting "403 forbidden" error on calling 'put' method. Why is it happening?
@RaghavPal
@RaghavPal 2 жыл бұрын
Hi Muneeb, you api may be needing some authorization, pls check or try with a diff api
@himachaliravi
@himachaliravi 9 ай бұрын
you did not explain why we need patch when we can do same in post
@RaghavPal
@RaghavPal 9 ай бұрын
Ravi Both methods serve different purposes: - POST: This method is used to create a new resource or submit data to the server. When you send a POST request, you're asking the server to accept the data enclosed in the body of the request and use it to create a new object. It's like adding a new file to a folder. - PATCH: This method is used for making partial updates to an existing resource. If you only need to update a few fields of a resource, PATCH is more appropriate. It's like editing a few words in a sentence without rewriting the whole page. Here's why you might choose PATCH over POST for updates: - Efficiency: PATCH requests only send the changes, rather than the entire updated entity, which can be more efficient for both bandwidth and processing. - Clarity: Using PATCH makes it clear that you're updating a resource rather than creating a new one. - Control: PATCH provides finer control over the update process, allowing partial updates and potentially reducing conflicts when multiple clients are modifying the same resource. In summary, while POST can be used for updates in some cases, PATCH is specifically designed for partial updates and can be more suitable for that purpose .
@lavanyasilla8744
@lavanyasilla8744 Жыл бұрын
how to create own api?????
@RaghavPal
@RaghavPal Жыл бұрын
Check this - kzbin.info/www/bejne/bafbYYV_rK2JsMk
@chinmayk2657
@chinmayk2657 Жыл бұрын
you have not shown post in intellij
@RaghavPal
@RaghavPal Жыл бұрын
I will check
@haroldambid9445
@haroldambid9445 10 ай бұрын
tytytyty
@RaghavPal
@RaghavPal 10 ай бұрын
Most welcome ..
Postman Beginner Tutorial 5 | DELETE API Request
3:17
Automation Step by Step
Рет қаралды 60 М.
Жездуха 42-серия
29:26
Million Show
Рет қаралды 2,6 МЛН
Почему Катар богатый? #shorts
0:45
Послезавтра
Рет қаралды 2 МЛН
GA4 Immersion: Introduction to module 1 (UNBOX)
0:40
Measurelab
Рет қаралды 137
Postman Beginner's Course - API Testing
2:09:38
freeCodeCamp.org
Рет қаралды 2,5 МЛН
What is the difference between a PUT and a PATCH request?
9:58
Jan Goebel
Рет қаралды 10 М.
Postman Beginner Tutorial 6 | Collections
8:44
Automation Step by Step
Рет қаралды 89 М.
Postman Beginner Tutorial 1 |  What is Postman
11:35
Automation Step by Step
Рет қаралды 329 М.
Difference Between REST API vs Web API vs SOAP API Explained
7:24
Learn with Whiteboard
Рет қаралды 280 М.