Skip to content

Latest commit

 

History

History
50 lines (31 loc) · 946 Bytes

lab7.mdx

File metadata and controls

50 lines (31 loc) · 946 Bytes

import { Head, Appear, Image } from "mdx-deck"; import Logo from "./assets/images/logos/rdc-icon.svg"; export { default as theme } from "./theme";

<title>React DeCal Lab 8</title>

Lab 8: Network Requests!

Project 1 due this Thursday!!!


What is a network request?


Making requests in JS

fetch("https://www.facebook.com") // returns a Promise
await fetch("https://www.facebook.com") // returns a Response object 

# Getting the text out of a response
let res = await fetch("https://www.reactdecal.org")
let responseText = await res.text();

Why is this useful?

  • We write webpages to help us display data!
  • Network requests help us ask servers for this data
  • Tons of public, free data sources (APIs) exist on the web

Demo


Attendance

http://bit.ly/RDAttendance