1 of 6

Working With �APIs

GIRLSCRIPT EDUCATION OUTREACH PROGRAM

PRESENTOR: SHUBHAM GOYAL

1

2 of 6

TOPICS TO COVER:

    • Fetch
    • Fetch images
    • Fetch Data from csv file
    • Fetch data from APIs

PRESENTOR: SHUBHAM GOYAL

2

3 of 6

1.Fetch?

  • JavaScript can send network requests to the server and load new information whenever it’s needed.
  • For example, we can use a network request to:
  • Submit an order,
  • Load user information,
  • Receive latest updates from the server,
  • …etc.
  • …And all of that without reloading the page!

PRESENTOR: SHUBHAM GOYAL

3

4 of 6

1.Fetch(cont.)

  • There’s an umbrella term “AJAX” (abbreviated Asynchronous JavaScript And XML) for network requests from JavaScript. We don’t have to use XML though: the term comes from old times, that’s why that word is there.
  • There are multiple ways to send a network request and get information from the server.
  • The fetch() method is modern and versatile, so we’ll start with it. It’s not supported by old browsers (can be polyfilled), but very well supported among the modern ones.

PRESENTOR: SHUBHAM GOYAL

4

5 of 6

PRESENTOR: SHUBHAM GOYAL

5

call fetch()

response

Complete data stream

promises

Text

Blob

json

Fetch Process

6 of 6

Thank You

SHUBHAM GOYAL

PRESENTOR: SHUBHAM GOYAL

6