Understand the fetch API

Share this video with your friends

Send Tweet

The way you make HTTP requests in React Native is with the Fetch API. In this video we'll talk about Fetch and how to work with promises.

Jason
Jason
~ 10 years ago

At the end of the video you mention that fetch isn't available for the browser yet, but it is available for React Native.

If I plan on writing a web app, (that also serves as a Hybrid Mobile App), that relies heavily on API calls, should I just stick to $.get(), or can I start using fetch?

Tyler McGinnis
Tyler McGinnis(instructor)
~ 10 years ago

Ironically Fetch went live a few days ago in the latest version of Chrome. But if you want ANY sort of older support, definitely go with $.get for now.

Joel Hooks
Joel Hooks
~ 10 years ago

Github has their fetch.js shim (which I used in the JSBin here).