Postman Beginner Tutorial 4 | PUT PATCH API Request

Поделиться
HTML-код
  • Опубликовано: 15 июн 2022
  • All FREE courses - automationstepbystep.com/
    Notes:
    How to add PUT & PATCH API Request
    Run and check Response
    #Postman #APITesting
    ____________________________________________________________
    Stories by Raghav - automationstepbystep.com/stor...
    My Udemy Courses - automationstepbystep.com/udem...
    Every LIKE & SUBSCRIPTION gives me great motivation to keep working for you
    You can support my mission for education by sharing this knowledge and helping as many people as you can
    If my work has helped you, consider helping any animal near you, in any way you can.
    _______ ONLINE COURSES TO LEARN _______
    automationstepbystep.com/free...
    GitHub - github.com/Raghav-Pal/
    Udemy - www.udemy.com/user/raghav-pal-3/
    Training by Raghav at your venue - raghav.qna@gmail.com
    Training schedule - automationstepbystep.com/trai...
    ----------- UI TESTING -----------
    Selenium Beginners - bit.ly/2MGRS8K
    Selenium Java Framework from Scratch - bit.ly/2N9xvR6
    Selenium Python - bit.ly/2oyMp5x
    Selenium Tips - bit.ly/2owxc50
    Selenium Builder - bit.ly/2MKNtlq
    Katalon Studio - bit.ly/2wARFdi
    Robot Framework with RIDE- bit.ly/2Px6Ue9
    Robot Framework with Eclipse - bit.ly/2N8DZxb
    Protractor - bit.ly/2KtqVkU
    TestProject - bit.ly/2DRNJYE
    ----------- API TESTING -----------
    Web Services (API) - bit.ly/2MGafL7
    SoapUI - bit.ly/2MGahmd
    Postman - bit.ly/2wz8LrW
    General - bit.ly/2PYdwmV
    Katalon Studio API Testing - bit.ly/2BwuCTN
    ----------- MOBILE TESTING -----------
    Appium - bit.ly/2ZHFSGX
    Mobile Playlist - bit.ly/2PxpeUv
    ----------- CI | CD | DEVOPS -----------
    Jenkins Beginner - bit.ly/2MIn8EC
    Jenkins Tips & Trick - bit.ly/2LRt6xC
    Docker - bit.ly/2MInnzx
    Kubernetes - bit.ly/2MJIlMK
    ------------VIRTUALISATION------------
    Virtualization on windows - bit.ly/2SItIL9
    ----------- VERSION CONTROL SYSTEM -----------
    Git & GitHub - bit.ly/2Q1pagY
    GitLab - bit.ly/2kQPGyQ
    ----------- PERFORMANCE TESTING -----------
    JMeter Beginner - bit.ly/2oBbtIU
    JMeter Intermediate - bit.ly/2oziNVB
    JMeter Advanced - bit.ly/2Q22Y6a
    JMeter Tips & Tricks - bit.ly/2NOfWD2
    Performance Testing - bit.ly/2wEXbLS
    ----------- PROGRAMMING -----------
    Java Beginners - bit.ly/2PVUcXs
    Java Tips & Tricks - bit.ly/2CdcDnJ
    GROOVY - bit.ly/2FvWV5C
    JAVASCRIPT - bit.ly/2KJDZ8o
    PYTHON - bit.ly/2Z4iRye
    ----------- IDE -----------
    Visual Studio Code - bit.ly/2V15yvt
    ----------- BUILD TOOLS -----------
    Maven - bit.ly/2NJdDRS
    Gradle - bit.ly/30l3h1B
    ----------- OTHERS -----------
    Redis- bit.ly/2N9jyCG
    Misc - bit.ly/2Q2q5xQ
    Tools & Tips - bit.ly/2oBfwoR
    QnA Friday- bit.ly/2NgwGpw
    Sunday Special - bit.ly/2wB23BO
    Ask Raghav - bit.ly/2CoJGWf
    Interviews - bit.ly/2NIPPxk
    All Playlists - bit.ly/2LSiezA
    ---------- Connect with Raghav -----------
    Udemy Courses - www.udemy.com/user/raghav-pal-3/
    Twitter - / learnwithraghav
    RUclips - / automationstepbystep
    Never Stop Learning
    Raghav

Комментарии • 75

  • @aylinbekem3701
    @aylinbekem3701 Год назад +14

    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  Год назад +1

      So nice of you Aylin

    • @akhil100
      @akhil100 Год назад +1

      Aylin I think you meant "inspired" and not "expired". :)

    • @aylinbekem3701
      @aylinbekem3701 Год назад

      @@akhil100 You are right . I just corrected

  • @AnjuliKhare
    @AnjuliKhare 2 года назад +6

    Hello Sir..Thank You So much for sharing video on postman. But plz share next video early so we can go fast .. thank you.

  • @revolver_84
    @revolver_84 Год назад

    Very clear and at a good pace video.
    Well done.

  • @CookingUnlocking
    @CookingUnlocking Год назад +1

    Great explanation with user friendly tools👍

    • @RaghavPal
      @RaghavPal  Год назад

      Glad it was helpful Sonu

  • @prasadchavakula8451
    @prasadchavakula8451 Год назад

    Nice video, now understood the importance between post and put
    Thanks Raghav

    • @RaghavPal
      @RaghavPal  Год назад

      Glad it was helpful Prasad

  • @gayatritankar7856
    @gayatritankar7856 9 месяцев назад

    Hello, Sir thank you so much for sharing these videos, it will be really helpful for us.

    • @RaghavPal
      @RaghavPal  9 месяцев назад +1

      So nice of you Gayatri

  • @marcioardanuy3089
    @marcioardanuy3089 4 месяца назад

    Amazing tutorial. Greetings from Brazil!!

    • @RaghavPal
      @RaghavPal  4 месяца назад +1

      Glad you liked it Marcio

  • @kuklosmissingeye9609
    @kuklosmissingeye9609 Год назад

    Saved me brother! Thank you :D

  • @mohammadhabib8334
    @mohammadhabib8334 2 года назад

    Thank you Raghav 😊

  • @justinecasiong9147
    @justinecasiong9147 Год назад

    thank you sir!

  • @jatingirdhar1589
    @jatingirdhar1589 4 месяца назад

    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  4 месяца назад

      I will add more on this Jatin... keep watching

  • @user-bz4bx3nd9x
    @user-bz4bx3nd9x 5 месяцев назад

    Good Explanation bro

    • @RaghavPal
      @RaghavPal  5 месяцев назад

      Thanks a lot Lakshmi

  • @fidawani7200
    @fidawani7200 7 месяцев назад

    Jio bhai Great explanation 😊

  • @amarnath1494
    @amarnath1494 9 месяцев назад

    Hi Raghav, Thanks for posting the video. Can you give more clarity b'n Put and Patch requests?

    • @RaghavPal
      @RaghavPal  9 месяцев назад

      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.

  • @prernasharma1307
    @prernasharma1307 2 года назад +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 года назад +1

      Hi Prerna, sure I will add a video on this, I recently created a community post for it, Can find it here - ruclips.net/channel/UCTt7pyY-o0eltq14glaG5dgcommunity

    • @prernasharma1307
      @prernasharma1307 2 года назад

      @@RaghavPal thanks Raghav... Will check

  • @YashSharma-qo1sy
    @YashSharma-qo1sy Год назад +1

    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

  • @mubashar-nouman
    @mubashar-nouman 9 месяцев назад

    Which tool you are using for highlighting something on screen? Like during video you highlight some sections with red bordered triangle etc

    • @RaghavPal
      @RaghavPal  9 месяцев назад

      It's screen annotation tools

  • @Tamanbir
    @Tamanbir Год назад

    What about updating an index of array? I get out of bound exception if i go as per docs

    • @RaghavPal
      @RaghavPal  Год назад

      will need to check the scripts and logs

  • @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.

  • @kalpanabadri27
    @kalpanabadri27 7 месяцев назад

    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  7 месяцев назад

      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.

  • @dantegutierrezsantos9367
    @dantegutierrezsantos9367 Год назад

    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  Год назад +1

      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

  • @moviekazi1536
    @moviekazi1536 Год назад +1

    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

  • @itsme-vc8fs
    @itsme-vc8fs Год назад

    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  Год назад

      its demo sample APIs, may have changed

  • @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

  • @vipintekade6400
    @vipintekade6400 Год назад

    Please add video including HEAD ,TRACE AND OPTION METHOD.

  • @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

  • @victoriduh3130
    @victoriduh3130 Год назад

    Please if I want to use patch request on all data in the api how do I do it?

    • @RaghavPal
      @RaghavPal  Год назад

      will need to see some example Victor

  • @muneeburrehman2280
    @muneeburrehman2280 2 года назад

    Hello sir. I am getting "403 forbidden" error on calling 'put' method. Why is it happening?

    • @RaghavPal
      @RaghavPal  2 года назад +1

      Hi Muneeb, you api may be needing some authorization, pls check or try with a diff api

  • @ammarsadeq6078
    @ammarsadeq6078 5 месяцев назад

    Is there no test to do at the end?

    • @RaghavPal
      @RaghavPal  5 месяцев назад

      Ammar
      Have covered Tests in a separate session.

  • @asimameer3445
    @asimameer3445 Год назад

    Is this course for API testing or developing the API?

  • @himachaliravi
    @himachaliravi 3 месяца назад

    you did not explain why we need patch when we can do same in post

    • @RaghavPal
      @RaghavPal  3 месяца назад

      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 9 месяцев назад

    how to create own api?????

    • @RaghavPal
      @RaghavPal  9 месяцев назад

      Check this - ruclips.net/video/7vx0RIwHVzg/видео.html

  • @chinmayk2657
    @chinmayk2657 Год назад

    you have not shown post in intellij

  • @haroldambid9445
    @haroldambid9445 4 месяца назад

    tytytyty