How to use fetch in JavaScript: GET, POST, PUT and DELETE requests

Поділитися
Вставка
  • Опубліковано 5 вер 2024
  • 👉 Source code: openjavascript...
    ⚡ Looking for high-performance, affordable web hosting for your website or app? We use HostWithLove: bit.ly/3V2RM9Q ❤️
    In this video, we cover how to use JavaScript's in-built fetch method to make API requests: GET, POST, PUT and DELETE. We also extensively cover error-handing, both using catch and by querying the response object.
    #javascript #api #fetch #webdevelopment #programming
    ⚡ NEW: Web development courses from Meta Inc. ⚡
    Front-End Developer Professional Certificate: imp.i384100.ne...
    Back-End Developer Professional Certificate: imp.i384100.ne...
    iOS Developer Professional Certificate: imp.i384100.ne...
    Meta Android Developer Professional Certificate: imp.i384100.ne...
    Meta Database Engineer Professional Certificate: imp.i384100.ne...
    Website: openjavascript...
    Twitter: / openjavascript

КОМЕНТАРІ • 30

  • @OpenJavaScript
    @OpenJavaScript  Рік тому

    Thanks for watching!
    👉Source code and how to use fetch with async/await: openjavascript.info/2022/01/03/using-fetch-to-make-get-post-put-and-delete-

  • @hananfadah
    @hananfadah 8 місяців тому

    Thanks so much. I finally now understood the difference!

  • @gillesa290
    @gillesa290 2 роки тому +1

    Fetch is now so easy ! Thank you for sharing.

  • @sasikumar2554
    @sasikumar2554 2 роки тому +2

    Well explained, clear and concise and it helps a lot for a beginner to understand with out breaking the head. Love the way you explain things. Thanks a lot. Keep up the good work!

    • @OpenJavaScript
      @OpenJavaScript  2 роки тому

      Thanks for the feedback. Always try to keep the videos beginner-friendly :)

  • @michaelolawunmi464
    @michaelolawunmi464 2 роки тому +2

    Thank you so much! This was one of the best explanations i found on this topic.

  • @febryramadhan1743
    @febryramadhan1743 2 роки тому +1

    how could this vidieos only get 6 likes? its the best videos i found for https request.. subscribed!!!

    • @OpenJavaScript
      @OpenJavaScript  2 роки тому

      Thank you for the feedback! And thanks for liking and subscribing - best way to support the channel :)

  • @youssefosama973
    @youssefosama973 2 місяці тому

    if there is an element consisits of 20 elms
    and want to update one of whom(16 as exapmle)
    i will use put method
    but i won't write all the 19 elms again
    so what is the best practice here??

  • @awakening7074
    @awakening7074 2 роки тому +1

    Fantastic tutorial! Thank you so much!

  • @roadtripper17
    @roadtripper17 2 роки тому

    Your teaching style and content are just great.

  • @jasonandrews7080
    @jasonandrews7080 2 роки тому +1

    Very clear tutorial ! Can you share the sample code please?

    • @OpenJavaScript
      @OpenJavaScript  2 роки тому

      Thank you for the feedback!
      You can find the sample code for all fetch request types on my website:
      openjavascript.info/2022/01/03/using-fetch-to-make-get-post-put-and-delete-requests/

  • @aminalamdarloo349
    @aminalamdarloo349 2 роки тому +1

    Dear bro
    Tnx for your video .
    I need to know how i can appear the captcha code in busy or overloaded sites when tis not shown ( just show the image box not captcha code) by get and post method.

    • @OpenJavaScript
      @OpenJavaScript  2 роки тому

      Did you find a solution to your question?
      Google has pretty good resources, maybe you find the answer there: developers.google.com/recaptcha

  • @mohammadhosseinkhanzadi6701
    @mohammadhosseinkhanzadi6701 2 роки тому +1

    thank you man

  • @borgk8546
    @borgk8546 Рік тому

    Thanks for this video, very useful and helpful information, for someone that's just starting. However I was wondering, if you are using checkboxes to delete the values in the frontend, how would you incorporate that in the fetch Delete request?

    • @OpenJavaScript
      @OpenJavaScript  Рік тому

      If you want to do this 'live', you will need to add event listeners to the checkboxes and make an API call every time a user checks or unchecks.
      But probably a better solution is to have a 'Save Settings' button that when clicked checks the values of the checkboxes and then makes an API call that feeds it that data. The exact nature of the request depends upon the API but if you can do some backend programming to support this it would be more efficient.

  • @codecobber1107
    @codecobber1107 2 роки тому

    Just brilliant, thanks

  • @Muhammad_X
    @Muhammad_X Рік тому

    Very helpful

  • @dzajakeks5539
    @dzajakeks5539 2 роки тому +1

    where async / await

    • @OpenJavaScript
      @OpenJavaScript  2 роки тому +1

      Async/await using Fetch: ua-cam.com/video/8JcCdp2Y4Q4/v-deo.html&t

    • @dzajakeks5539
      @dzajakeks5539 2 роки тому

      @@OpenJavaScript thank you for the link