• Saturday , 30 May 2020

How to use Fetch with JavaScript

Code Canyon

Fetch is a promise based HTTP request API. It’s fairly well supported (87%+ https://caniuse.com/#feat=fetch) and is promise based for ease of use and is a perfect fit for those wanting to use out of the box solutions for HTTP.

For more information, check out the MDN documentation on how to use Fetch within your project(s): https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch


Chat with me, join the Slack group! http://bit.ly/JoinPaulHallidaySlack

I have courses related to Angular, Ionic, Fuse, Firebase and much more at: https://paulhalliday.io

My NativeScript courses can be found at:

I also have an Ionic book:

Prefer written content or want a text version of the videos? Check out
my blog: https://blog.paulhalliday.io

Support the content with at least $1 for EXCLUSIVE early access to the next video(s), as well as other benefits! https://www.patreon.com/PaulHalliday

You can also support the content by keeping me caffeinated (much appreciated!): http://paypal.me/PWHSoftware

The extra epic content always comes via email first. Sign up so you’re not left behind: http://eepurl.com/cBCqO9

You can also find me:


Original source

3d Ocean

Related Posts


  1. ROFEL
    July 15, 2019 at 14:13

    There is so much missing information in this.

    Where do you put this code?
    Do you put it in server.js where express is?

    How do you fetch data from an API?
    What if the API requires a key? How do you input a key?

    If the URL you're fetching from requires the content of the form, how do you get the values from the form to be included in the URL in the fetch in the first place?

  2. m.nageh
    July 15, 2019 at 14:13

    you need to explain more !!

  3. John White
    July 15, 2019 at 14:13

    I use StackBlitz, it is ok?

  4. John White
    July 15, 2019 at 14:13

    Hi Paul. Thank you for a tutorial about Fetch with JS. One question: It means that I can create own post, then to make a request to use it in my app, correct? So, where data will be stored? Also, I would like to use some own images for the data request, is it possible, please explain how to add images as well. Thank you in advance.

  5. Muhrochka // Мурочка
    July 15, 2019 at 14:13

    So easy to undestand. Huge thanks to the author

  6. Green31
    July 15, 2019 at 14:13

    I can do it with blogger api?

  7. Pavan Jadhaw
    July 15, 2019 at 14:13

    If may I ask what color theme is that?

  8. Lednar Kuro
    July 15, 2019 at 14:13

    where's the like button!!!!!

  9. Bryan Dela Cruz
    July 15, 2019 at 14:13

    hi do you have codes for edit function? thanks

  10. Tavian
    July 15, 2019 at 14:13

    This video saved me so much time! You're a lifesaver! Keep up the great work!

  11. EntertainmentLoLz
    July 15, 2019 at 14:13

    can i know the theme name Paul ?

  12. Yihao WU
    July 15, 2019 at 14:13

    Can I ask how did you auto add the code inside the curly braces at 1:03?

  13. msaldev
    July 15, 2019 at 14:13

    Thank you sooo much, really appreciate it.

  14. Andres Leon Rangel
    July 15, 2019 at 14:13

    thanks. Maybe you should remind new programmers about the best practices you are using. Thanks

  15. Claudio Maldonado Salvador
    July 15, 2019 at 14:13

    Stop trying to make fetch happen. It's not going to happen!

  16. Shivam Waghela
    July 15, 2019 at 14:13

    I'm getting fetch is not defined error

  17. MrKiraBR
    July 15, 2019 at 14:13

    Amazing video, but these curly braces are really weird.

  18. AymanMorsy
    July 15, 2019 at 14:13


  19. Laura Enria
    July 15, 2019 at 14:13

    const newPost it's confusing imho!

  20. Robert's Take
    July 15, 2019 at 14:13

    could i uset the getpost() with a search box to show data from the backend to the frontend ?

  21. Kim
    July 15, 2019 at 14:13

    What's that font you are using? Looks neat!

  22. B33SON
    July 15, 2019 at 14:13

    Better to use async await.

  23. Craig Johnson
    July 15, 2019 at 14:13

    You didn't explain how you connected to http://localhost:8080? When you go to the console it's somehow connected?

  24. Lucas
    July 15, 2019 at 14:13

    amazing, I like ur vue.js videos

  25. Dablio Del
    July 15, 2019 at 14:13

    Nice keep it up

  26. rickyu1978
    July 15, 2019 at 14:13

    would love a complimentary video to axios

  27. Joe Prabawa
    July 15, 2019 at 14:13

    Hi paul, thanks for the tutor ! 😉 if its not bother you, can i ask you about making a video about an introduction to OAuth 2.0 and using fetch to get an access token ? Ive been stumbling with this oauth system. Thank you so much before paul

  28. Daniel Sokil
    July 15, 2019 at 14:13

    Thanks! What editor and theme are you using?

  29. Jonas De Vrient
    July 15, 2019 at 14:13

    What's theme are you using and nice vid!

  30. zaharouni1
    July 15, 2019 at 14:13

    Hey Paul ! how Flutter are you ? 😉

Leave A Comment

You must be logged in to post a comment.