Class 7 Prep
We are now transitioning to a point in the class where we will be making a bunch of HTTP requests to external servers, and processing the data we receive back. This, of course, is what a browser does every time you visit a webpage. But it turns out there are other ways, besides "visiting a page", of making HTTP requests. On the front-end, one very common technique for making requests is using a technique called AJAX, which you will learn about in the Udacity course below.
Before coming to Class 6, please complete the following tasks:
cURL
cURL is a command-line tool that lets you simply make HTTP requests and see the response. This is a helpful tool for debugging, and for playing around the APIs of third-party sources that make their data available (like in the Udacity course below).
| Done | Task | Resource Type | Link | Time Estimate | Instructions |
|---|---|---|---|---|---|
| Follow-Along | Article | cURL Tutorial | 30 minutes | As you read this article, make sure to open up a Terminal window follow along with the examples. |
JSON
When sending and receiving data, there are a variety of different standards for the exact syntax of how to structure the data as text. These days, the most common standard is JSON.
| Done | Task | Resource Type | Link | Time Estimate | Instructions |
|---|---|---|---|---|---|
| Read | Article | What is JSON: the 3 minute JSON Tutorial | 3 minutes! | This (very old) article gives a quick intro to JSON. | |
| Read | Stack Overflow Post | What is JSON and Why Should I Use it? | a few more minutes | Quickly read this SO post on JSON. |
AJAX
In Javascript, you can make a request to a server, wait for the response to come back, and then do something with the response, without the user ever having to leave or refresh the page. This technique is called AJAX. This is how Gmail, for example, makes your newly received email appear instantly in your inbox, even without you refreshing the page.
| Done | Task | Resource Type | Link | Time Estimate | Instructions |
|---|---|---|---|---|---|
| Do | Article | CSS Tricks: Using Fetch | 20 minutes | This article explains how to use the built-in fetch function to bring data from other sources into your page. Feel free to stop once you get to the "Handling other response types" portion. |
|
| Do | Documentation | MDN: Using Fetch | 20 minutes | Documentation for how to use fetch, with many examples. |