From the course: JavaScript: Ajax and Fetch
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Research and create an Ajax request URL - JavaScript Tutorial
From the course: JavaScript: Ajax and Fetch
Research and create an Ajax request URL
- [Instructor] Once you've identified the API you want to use, the next step is to build a request. Modern web services are based on an architecture called REST, which uses HTTP requests and responses to exchange information. So we need to write a URL that requests the information we want. APIs often provide access to multiple types of data and you need to examine the documentation to find how to request the specific data you want. When an API gives different URL paths, these are known as endpoints and you need to pick the correct one for the data you want. The SmartyStreets U.S. street address API returns nine-digit zip codes. Even though there's another API called the zip code API, that actually requires a zip code to start. So, again, the documentation is super valuable when you're first picking an API and endpoint and then figuring out how to use it. Now here on the overview page, there's a demo form that creates requests and shows responses. There are a lot of fields here that…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
What is Ajax?2m 23s
-
(Locked)
Understand asynchronous program flow2m 53s
-
(Locked)
Get an API key6m 42s
-
(Locked)
Research and create an Ajax request URL3m 50s
-
(Locked)
Create an XHR request5m 13s
-
(Locked)
Test an XHR request5m 51s
-
(Locked)
Handle XHR success and failure5m 38s
-
(Locked)
Challenge: Build an XHR request56s
-
(Locked)
Solution: Build an XHR request5m 3s
-
-
-
-
-
-