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
@RaghavPal2 жыл бұрын
So nice of you Aylin
@akhil1002 жыл бұрын
Aylin I think you meant "inspired" and not "expired". :)
@aylinbekem37012 жыл бұрын
@@akhil100 You are right . I just corrected
@nischalkoirala70649 күн бұрын
@@aylinbekem3701 expired lol
@AnjuliKhare2 жыл бұрын
Hello Sir..Thank You So much for sharing video on postman. But plz share next video early so we can go fast .. thank you.
@RaghavPal2 жыл бұрын
I will try Anjuli
@marcioardanuy308910 ай бұрын
Amazing tutorial. Greetings from Brazil!!
@RaghavPal10 ай бұрын
Glad you liked it Marcio
@fidawani7200 Жыл бұрын
Jio bhai Great explanation 😊
@RaghavPal Жыл бұрын
Thanks a lot
@prasadchavakula8451 Жыл бұрын
Nice video, now understood the importance between post and put Thanks Raghav
@RaghavPal Жыл бұрын
Glad it was helpful Prasad
@gayatritankar7856 Жыл бұрын
Hello, Sir thank you so much for sharing these videos, it will be really helpful for us.
@RaghavPal Жыл бұрын
So nice of you Gayatri
@GamingUnlocking2 жыл бұрын
Great explanation with user friendly tools👍
@RaghavPal2 жыл бұрын
Glad it was helpful Sonu
@jatingirdhar158910 ай бұрын
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 !
@RaghavPal10 ай бұрын
I will add more on this Jatin... keep watching
@prernasharma13072 жыл бұрын
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
@RaghavPal2 жыл бұрын
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
@prernasharma13072 жыл бұрын
@@RaghavPal thanks Raghav... Will check
@mohammadhabib83342 жыл бұрын
Thank you Raghav 😊
@RaghavPal2 жыл бұрын
So nice of you
@mv8167 Жыл бұрын
Could you please tell me how you got to the Rest Request at time 1:16, showing the resources we can use?
@RaghavPal Жыл бұрын
Hi Mike, it is a demo rest service available here - thomas-bayer.com/sqlrest
@revolver_842 жыл бұрын
Very clear and at a good pace video. Well done.
@RaghavPal2 жыл бұрын
Thanks a lot
@kuklosmissingeye96092 жыл бұрын
Saved me brother! Thank you :D
@RaghavPal2 жыл бұрын
Most welcome
@amarnath1494 Жыл бұрын
Hi Raghav, Thanks for posting the video. Can you give more clarity b'n Put and Patch requests?
@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.
@LakshmiGaneshGupthaBachu11 ай бұрын
Good Explanation bro
@RaghavPal11 ай бұрын
Thanks a lot Lakshmi
@learnitrussian4 ай бұрын
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?
@RaghavPal4 ай бұрын
these are dummy APIs and they do not change anything at the backend
@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 Жыл бұрын
It's screen annotation tools
@Tamanbir2 жыл бұрын
What about updating an index of array? I get out of bound exception if i go as per docs
@RaghavPal2 жыл бұрын
will need to check the scripts and logs
@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 Жыл бұрын
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 Жыл бұрын
Thanks for the video, sir. But couldn't get any difference between PUT and PATCH!
@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 Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
This may be the case as these are dummy APIs we are using for demo
@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 Жыл бұрын
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
@justinecasiong91472 жыл бұрын
thank you sir!
@RaghavPal2 жыл бұрын
Most welcome Justine
@dantegutierrezsantos93672 жыл бұрын
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.
@RaghavPal2 жыл бұрын
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-vc8fs2 жыл бұрын
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
@RaghavPal2 жыл бұрын
its demo sample APIs, may have changed
@ammarsadeq607811 ай бұрын
Is there no test to do at the end?
@RaghavPal11 ай бұрын
Ammar Have covered Tests in a separate session.
@victoriduh31302 жыл бұрын
Please if I want to use patch request on all data in the api how do I do it?
@RaghavPal2 жыл бұрын
will need to see some example Victor
@vipintekade64002 жыл бұрын
Please add video including HEAD ,TRACE AND OPTION METHOD.
@RaghavPal2 жыл бұрын
Sure Vipin, will plan to add
@vipintekade64002 жыл бұрын
With practical examples.
@RaghavPal2 жыл бұрын
ok
@sivaporeddy722 жыл бұрын
What happens if we use PATCH to update both name and Job. Is that not similar to PUT?
@RaghavPal2 жыл бұрын
Hi Siva, Patch - update some information of the resource Put - replace the resource
@asimameer34452 жыл бұрын
Is this course for API testing or developing the API?
@RaghavPal2 жыл бұрын
Testing API
@muneeburrehman22802 жыл бұрын
Hello sir. I am getting "403 forbidden" error on calling 'put' method. Why is it happening?
@RaghavPal2 жыл бұрын
Hi Muneeb, you api may be needing some authorization, pls check or try with a diff api
@himachaliravi9 ай бұрын
you did not explain why we need patch when we can do same in post
@RaghavPal9 ай бұрын
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 .