Fetch API - JavaScript Tutorial for beginners

Sdílet
Vložit
  • čas přidán 25. 06. 2024
  • JavaScript Fetch API, how to use in with Promises, how it is different from XHR, and why use it?! This is episode 14 of 20 things Javascript Developers Should Know But Probably Don't.
    00:00:00 Intro
    00:00:45 What is Fetch?
    00:01:51 Request()
    00:02:52 Response()
    00:04:09 🔴 Demo: Simple GET
    00:08:12 🔴 Demo: Simple GET with Parameters
    00:10:58 Request Parameters
    00:12:10 Headers
    00:12:49 🔴 Demo: Headers
    00:17:12 Error Handling
    00:17:41 🔴 Demo: Error Handling
    00:26:24 History of Fetch and XHR
    00:25:40 POST Request
    00:28:00 Why Fetch?
    00:22:59 Outro
    Links mentioned in the video:
    List of Free APIs:
    free-apis.github.io/
    publicapis.dev/
    rapidapi.com/collection/list-...
    ColorCode Etsy Merchandise store:
    www.etsy.com/shop/ColorCodeStore
    Episode 11: Asynchronous JavaScript:
    • Async JavaScript & Cal...
    Episode 12: JavaScript Promises:
    • JavaScript Promises -...
    Episode 13: Async Await
    • Async Await vs. Promis...
    Using Fetch (MDN):
    developer.mozilla.org/en-US/d...
    Full playlist here: • 20 Things JavaScript D...
    JavaScript Promises from the series "20 Things JS Developers Should Know but Probably Don't"
    by ColorCode.io, Sina Jazayeri
    ** Announcement **
    Full JavaScript Mastery course is coming! Details at the end of the video. Sign up for Early Access here:
    www.colorcode.io/js-mastery

Komentáře • 440

  • @ColorCodeio
    @ColorCodeio  Před rokem +57

    Fetch API 🕺🏻👨🏻‍💻🎉 from the series 20 Things JavaScript Developers Should Know but Probably Don’t’.

  • @aboveandleon4267
    @aboveandleon4267 Před 3 měsíci +7

    Just started my coding journey about 3 months ago. I'm so glad I found your channel, just by watching this one video I can tell that you are a phenomenal teacher that not only explains things really well, but you just make it super fun to listen to. Thank you!!

    • @ColorCodeio
      @ColorCodeio  Před 3 měsíci

      Great to hear! Good luck in your journey.

  • @ClashRoyale-pt9zj
    @ClashRoyale-pt9zj Před 10 měsíci +36

    Sooner or later you'll get even more audience, that's for sure. Your quality is kinda unique here about JS (not boring, completely understandable even for foreigners and showing a great depth of knowledge at the same time).

    • @ColorCodeio
      @ColorCodeio  Před 10 měsíci +3

      Thank you 🙏🏼

    • @d.minkov
      @d.minkov Před 9 měsíci +1

      @@ColorCodeioWhy no videos anymore 😢

  • @itsanuragjoshi
    @itsanuragjoshi Před měsícem +2

    This is probably the best, simplest explanation I could find on CZcams. Great work :)

  • @blazingelse9104
    @blazingelse9104 Před 6 dny

    I love that you forgot to bleep out 29:29. Great series! I already know almost everything you are talking about, but wouldn't be able to articulare it that well or give such good reasoning. This helps me to teach others!

  • @mohammadabbas1623
    @mohammadabbas1623 Před 11 měsíci +3

    man, i can listen to you for the whole day, so calm..

  • @scottldn
    @scottldn Před 9 měsíci +4

    Consistently some of the best explained videos on these more advanced JS topics, really appreciate the time and effort being put into these!

  • @thebunsenburner
    @thebunsenburner Před rokem +10

    Your videos are literally giving me the willpower to continue with my current assignment. Thank you! Excellent work, honestly.

  • @Poprostuoskar359
    @Poprostuoskar359 Před rokem +2

    was waiting ages for .this vid :), great work!

  • @akashkadam2741
    @akashkadam2741 Před 10 měsíci +1

    I'm currently learning js and this series is a game changer, thank you ColorCode

  • @orrodrigez5051
    @orrodrigez5051 Před rokem +1

    I'm so happy to see you continuing with the series :D
    Whenever someone is stuck on one of these topics i send them right to your videos!

  • @arthurbulat9532
    @arthurbulat9532 Před rokem +8

    Awesome just as usual! You got the most stylish and informative tutorials

  • @bsrat4395
    @bsrat4395 Před 7 měsíci +1

    i love how sarcastic he is and i've only watched his video for like 2seconds...wow!! keep it up man

  • @UFO_808
    @UFO_808 Před rokem +2

    Dude, I love your style of teaching and sense of humor

  • @12345678uygfcxdrtghn
    @12345678uygfcxdrtghn Před rokem +3

    I enjoy watching your tutorials alot! Keep up the good work!

  • @harikrishnanpandyan5684

    Waiting for it 🔥🔥🔥🔥

  • @kooroshirani
    @kooroshirani Před rokem +1

    you are the best teacher i have ever seen thank you please go on and create a lot of programming videos درود بهت آقا سینا

  • @dylanrh
    @dylanrh Před rokem +1

    it's always so entertaining to watch one of your classes! thank youu

  • @clash1469
    @clash1469 Před 4 měsíci +2

    This is the best tutorial series I've seen yet. The production quality is excellent, the information is delivered in a straight-forward, understandable manner and I don't even hate all the puns. Very, very nicely done. Thank you for all the work that obviously went into this.

    • @ColorCodeio
      @ColorCodeio  Před 3 měsíci

      Thank you for taking the time to tell me that :)

  • @daniillitvinenko4348
    @daniillitvinenko4348 Před rokem +1

    Thank you man. Excellent edition.

  • @johnforeverrules
    @johnforeverrules Před rokem +1

    glad that you are back sensei

  • @matts9063
    @matts9063 Před 6 měsíci +1

    Really great video! Love the style, music, pacing. Awesome work and thank you for the help!

  • @asmaakhalidy3775
    @asmaakhalidy3775 Před 10 měsíci

    i loved the way you break down things and your positive energy 😊. Thank you 🙏!

  • @ebcoutinho
    @ebcoutinho Před 20 dny

    I'm a JS/TS junior developer from Brazil. Thank you so much for sharing your knowledge with us! Really, you did a great job, my man!

  • @sleepysapphire2349
    @sleepysapphire2349 Před rokem +1

    The best series on Javascript Intermediate and Advance concepts!

  • @nike_fake
    @nike_fake Před 8 měsíci +3

    the best video on fetch api i have found on youtube

  • @user-hc9yz8jz7d
    @user-hc9yz8jz7d Před 8 měsíci +2

    Please just keep uploading, you are giving your knowledge on a so special way, fun and easy, the way that nobody else does. I see you as an idol for myself👍❤

  • @kamrulislam3841
    @kamrulislam3841 Před 10 měsíci

    Raw knowledges are the backbone of a great developer. Thank you for great teaching

  • @namankeshari7332
    @namankeshari7332 Před 10 měsíci +1

    Your videos are soo freaking good!! Just love it!

  • @DennisMinard
    @DennisMinard Před 10 měsíci +1

    As a Test Automation Engineer, about a year ago I switched my C# brain over to JavaScript because I was building my test framework with Cypress. I've been stumbling along the whole year with no formal training, just getting by in making my tests to work even though I knew that I really didn't understand why sometimes the way I wrote the code worked, and sometimes not. Most of the tests start off calling many level nested promise-then blocks because to get the website up takes a lot of steps. Your series has been absolutely what I've needed and given me lots of ideas on how to refactor my code! Thanks so much for your series! Keep it up.

    • @ColorCodeio
      @ColorCodeio  Před 10 měsíci +3

      Want to make sure I reply to your comment before it gets lost in the shuffle. First, I appreciate your kind words and the fact that the videos have helped you. But also this is something I personally deal with on a daily basis in my day job as an engineering manager. I’m a big advocate of Cypress and automated testing. We use it in my organization, it’s such an underrated tool for building resilient software. The unfortunate thing about it is what you mentioned: most JS developers don’t actually know how the language works without significant help of modern frameworks, or even sometimes with them. So, I feel your pain, I’m glad you’re making progress, and I wish you a ton of success. Don’t give up.

  • @sudiptasaha8905
    @sudiptasaha8905 Před rokem +2

    Finally my request for DOM API has been accepted. Really looking forward to the next episode for another great content.

  • @user-uv6wv7xz4q
    @user-uv6wv7xz4q Před 8 měsíci +1

    need more content like this from you, a course on react will be awesome

  • @awaismohsin345
    @awaismohsin345 Před rokem +1

    Wellcome back Boss, I was waiting ❤

  • @AtmaniChouaib
    @AtmaniChouaib Před 9 měsíci +1

    You content quality is just perfect, unlike other boring coding tuts, thank you this was really helpful

  • @spooki6637
    @spooki6637 Před 5 měsíci

    I can’t believe this is free. You can charge thousands of dollars for this series truly high quality

  • @khouloudbenromdhane1524
    @khouloudbenromdhane1524 Před rokem +2

    Oh my god, i LOVE your intros and i am enjoying them, specially this one, keep it up!

  • @jaygarricktheflash
    @jaygarricktheflash Před rokem

    Fetch betta have my data!!! You have probably the most confortable learning enviornments. I appreciate the effort creating wonderful atmosphere and visual effects.

  • @ugaasxnaz6926
    @ugaasxnaz6926 Před rokem +1

    Please don't give up! Your videos are incredible!

  • @erfanlatifi5342
    @erfanlatifi5342 Před rokem

    salam sina jan merci az khodet va qoli babate video hat sabke tozih dadanet va energy e ke dari kheili khafane hamishe movafagh bashi .

  • @vinception777
    @vinception777 Před 10 měsíci

    Actually love the fact that you went to search for some TOOL with your request, I definetly did great subscribing to this channel, thanks for all the knowledge sharing in this serie, it was of great help to me :)

  • @ebcoutinho
    @ebcoutinho Před 13 dny +1

    this is pure gold

  • @vishtrinity
    @vishtrinity Před 6 měsíci +1

    the best explanation for promises ,async await and fetch till date...ur channel is really underrated ...i would say its the gold standard of adv js tutorials...thanks for the 20 part series

  • @edhead76
    @edhead76 Před 4 měsíci +1

    you're the trendiest youTube developer, man. your style is sick and your tutorials easy to follow; they make the user feel at ease. thank you for all these awesome series you've put together. I feel much more competent as a developer because of your wisdom.

  • @sabu4539
    @sabu4539 Před 8 měsíci +4

    love your vids. would love to see recursion, hoisting, pure/impure functions, shallow/deep copy and memoization

  • @jacobwwarner
    @jacobwwarner Před 6 měsíci +3

    I've been binge watching your videos over the last few days. Your natural, conversational delivery is absolutely brilliant. There are so many people doing JavaScript (React) project based tutorials, but this has been really nice series on vanilla JavaScript features. It's really helped me understand promises and async-await more clearly. I'd love to see a playlist series on Node.js and web servers. I'm not sure where your technical focus is, but understanding the more basic, core functionality and features of JavaScript on the server would be of great help to me and possibly others. So, to clarify not exactly a project based tutorial video playlist of how to use Node.js, but something like this where you're focusing on specific features of Node.js. Again, I'm not sure if that aligns with your interests and expertise, but it would be nice. Thanks for the work and commitment to these video series!!

  • @user-mj2xg8qj5g
    @user-mj2xg8qj5g Před 11 měsíci

    the intro cracks me everytime :D

  • @jayteecollins1279
    @jayteecollins1279 Před 4 měsíci

    bro im impressed how you deliver this tutorial! just subscribed

  • @toms3903
    @toms3903 Před 9 měsíci +1

    Fantastic lessons and professionally done! I stumbled over your lessons while searching on the topic of API calls. It's the best explanatoin of async vs sync, callbacks and promises related to JS I have seen so far. I took several JS courses, but haven't heard or read anyone explaining it as well as you do. And now I will start from lesson 1. Thank you for this amazing information!

    • @ColorCodeio
      @ColorCodeio  Před 9 měsíci

      Thank you for very much for the comment! Glad these have been helpful for you.

  • @eumm11
    @eumm11 Před rokem

    awesome like always, can't wait for the dom api!

  • @adamhmid
    @adamhmid Před rokem +1

    Best js series by far. Thank you!

  • @Reeko571
    @Reeko571 Před 3 měsíci +1

    I've been really liking all your videos lately! keep it up :D

  • @trueWordss.
    @trueWordss. Před 11 měsíci +1

    I wish you could upload whole js course from basic to pro. The way of your explanation is just amazing.

  • @ivonnebenites3308
    @ivonnebenites3308 Před 9 měsíci

    Thank you, this video about the 'fetch' method helped me understand more about how to retrieve and send data from APIs using 'fetch' 🙏🏿⭐

  • @maximusquietus
    @maximusquietus Před 11 měsíci +1

    I've been going through this series the past few days. Each time I went back to your channel it would play the beginning of this video. It was funny every time. 😄

  • @bernardsamapoh3619
    @bernardsamapoh3619 Před rokem +1

    Really enjoy this episode. Thanks a lot.

  • @mirjalol_shamsiddinov
    @mirjalol_shamsiddinov Před rokem +2

    the best the best the best. this was so needed to me, tomorrow i gotta do lecture about Fetch, this video is the best. i know i used the word best a lot, cos this person deserves that

    • @ColorCodeio
      @ColorCodeio  Před rokem

      Thank you, good luck with your lecture!

  • @user-uv6wv7xz4q
    @user-uv6wv7xz4q Před 8 měsíci +1

    never seen a video like this before i learnt coding from a lot of resources even paid ones, and none of them matches the quality and ease of explanation and only giving what is important and to the point

  • @user-lc9sk4em5b
    @user-lc9sk4em5b Před 5 měsíci

    Great work, awesome explanations

  • @adnantariq3346
    @adnantariq3346 Před 11 měsíci +1

    The frustration at 1:50 “which I’ll get to in a minute” 😂

  • @th3ja
    @th3ja Před 5 měsíci +3

    New to your awesome channel! Been enjoying the Js series!
    Btw, your teaching is top notch. Explanation and examples are crystal clear!
    Excellent for learning fundamentals. Keep up the great work!

  • @christhornham
    @christhornham Před 5 měsíci +1

    Excellent video! Thank you.

  • @moneyfr
    @moneyfr Před rokem +1

    Your work is so clean. Thank you

  • @atsgames807
    @atsgames807 Před 8 měsíci

    i love your explining style

  • @user-kn4oi9oh4i
    @user-kn4oi9oh4i Před 3 měsíci +2

    You're an awesome and amazing teacher! The topics that you teach are the hardest to understand and yet you managed to explain it so well! Thank you for creating this chamnel! I shall send this series to some of my programmer friends ❤

    • @user-kn4oi9oh4i
      @user-kn4oi9oh4i Před 3 měsíci +1

      Omg, while I'm watching the tutorial, I can't help but to be happy because Im starting to understand API which I wasn't able to understand in some other courses and tutorial that I watched months ago. You are truly an angel good sir.

    • @ColorCodeio
      @ColorCodeio  Před 3 měsíci

      Awesome! Glad to hear

  • @AustroPower
    @AustroPower Před rokem +1

    Much love for the effort you put in bro, great tutorials! Keep it up! Subbed of course :)

    • @ColorCodeio
      @ColorCodeio  Před rokem

      Glad it was helpful and thanks for the sub.

  • @imranmani2036
    @imranmani2036 Před rokem +1

    I started watching your episode 3 months ago and I really learn a lot from your videos super quality content I've found with amazing explanation. I was waiting for upcoming videos and the day is come. Thanks 🙏 love from Pakistan

    • @ColorCodeio
      @ColorCodeio  Před rokem +1

      That's great. Thank you for sharing.

  • @215Leon215
    @215Leon215 Před rokem +1

    Fantastic video as usual!

  • @elielberra2867
    @elielberra2867 Před 4 měsíci

    Amazing video!!

  • @oncoding4520
    @oncoding4520 Před 10 měsíci

    Love your content. Love your humor love your explanation. I just checked if there is any posts :) Keep going :)))

  • @luckydude2231
    @luckydude2231 Před 9 měsíci +1

    Sina! I really have enjoyed your videos, very helpful and engaging. I love the way you present the information and your personality!

  • @iyegeremeriton6793
    @iyegeremeriton6793 Před rokem +1

    I really, I mean really love how you explain concepts, just a minute into this video and I subscribed ✌️

  • @jabulaniusen6329
    @jabulaniusen6329 Před rokem +1

    The starting of the video is 🔥

  • @solide_ahmed7907
    @solide_ahmed7907 Před 11 měsíci +1

    thank you so much i watched all the 14 series and what an awesome explanations !!

    • @ColorCodeio
      @ColorCodeio  Před 11 měsíci

      Glad it was helpful! More coming soon.

  • @freak7053
    @freak7053 Před 5 měsíci +1

    Hello thank you for the explanation, it was smooth and I didn't even need to go back

  • @caiovidinha
    @caiovidinha Před 11 měsíci +2

    Cheers from Brazil (First text in the news API response was in portuguese, but refering to an accident that happened in Italy)
    Your content is saving me in my journey to become a full stack developer

  • @alex_blue5802
    @alex_blue5802 Před 11 měsíci +1

    Oh no I reached the end. I'm an experienced developer but I've learned so much about the underlying logic of JavaScript by watching this course. I hope the new one comes out soon.

    • @ColorCodeio
      @ColorCodeio  Před 11 měsíci +1

      Glad you like the videos. They're not purely made for beginners. More coming soon.

  • @harvard004
    @harvard004 Před 11 měsíci +1

    Need you back Sina! How about a short on using Fetch with CURL? Jest testing/mocking videos? Time/Space complexity? Git/github? React? Love your content - has helped me tremedously.

  • @endfine9230
    @endfine9230 Před 2 měsíci

    Thanks for such Qolity content, I finally started to understand the topic of asynchrony🥳

  • @ComputerScience-pd7nd
    @ComputerScience-pd7nd Před rokem +1

    Great video. Thank you so much for this.

  • @michi19935
    @michi19935 Před 6 měsíci +1

    That was a really good and also fun tutorial - keep it up

  • @Mcbaguette714
    @Mcbaguette714 Před rokem +1

    Thank you so much for this!

  • @ShubhamPatil-di1nx
    @ShubhamPatil-di1nx Před rokem +1

    very informative and helpful

  • @tiagdvideo
    @tiagdvideo Před 9 měsíci +1

    This is the best tutprial on this topic by a huge margin.
    Going to look back through your other videos and I hope you do more
    Thanks

  • @cholo2605
    @cholo2605 Před 8 měsíci +1

    Amazing video !!!! thanks chief

  • @user-di1pl3yy6o
    @user-di1pl3yy6o Před 7 měsíci +3

    wow. This is so helpful and in same time so amusing that I can't even decide for myself whether it was an entertaining or educational video. Many thanks for great time ❤

  • @voxmor
    @voxmor Před 3 měsíci

    Very well explained, thanks!

  • @wzt9376
    @wzt9376 Před 6 měsíci +1

    I rarely comment to be honest but hands down you are really the best teacher I have found to explain all of this. Sad we dont get as much videos as I would hope but I also get that such quality content takes time. I had so much fun learning with you I hope we see the masterclass soon. 😊

    • @ColorCodeio
      @ColorCodeio  Před 6 měsíci

      Thanks for saying that. A lot more videos coming soon. I promise :)

  • @manemanoj3068
    @manemanoj3068 Před rokem

    amazing explanation bhai waiting for more ...

  • @AurelioPita
    @AurelioPita Před rokem +1

    Great quality. i need these videos to send to junior developers. Many thanks.

  • @Parhoom
    @Parhoom Před rokem

    awesome! keep up the great work

  • @respectableandserious
    @respectableandserious Před 9 měsíci

    It's Just Amazing!

  • @jardagalvao
    @jardagalvao Před 4 měsíci +1

    Amazing content man. Thanks 👌

  • @Noahmetix
    @Noahmetix Před 8 měsíci +1

    Your videos are amazing, I watched a lot of videos trying to understand and this was the only one that helped me understand, Thank you for creating theses contents.

  • @TahaTopal
    @TahaTopal Před 9 měsíci +3

    It was a great series of videos I'll be waiting for DOM fundamentals. However, I like to see you covering particularly JavaScript classes (syntactic sugar) as well with its topics such as access modifiers, get-set methods and inheritance capabilities.

  • @aftalavera
    @aftalavera Před rokem +1

    Quality is impressive!

  • @rewatipoudel
    @rewatipoudel Před 10 měsíci +1

    with respect, i feel like what the hell! how can anyone explain that so easy. its like a drug man

  • @siddharth8911
    @siddharth8911 Před 6 měsíci +1

    Best video on fetch i have ever seen. You nailed it bro 🤜🤜🤜

  • @hirookenji
    @hirookenji Před 9 měsíci +1

    A well done perfect tutorial which is not boring to watch this is very rare that I spent 30 mins watching a video about programming without even realizing it. Hope you make a tutorial about Vue or React Framework. Thank you!

  • @reagan574
    @reagan574 Před rokem

    Best tutorials on CZcams 😍

  • @tylerdrummond91
    @tylerdrummond91 Před rokem +1

    You are a great teacher! Very clear examples, well paced and best of all, delivered with fantastic humour. I’m subscribed for life and looking forward to learning more from you. (Though hopefully it doesn’t take me all life to learn this language 😂).