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

Research and create an Ajax request URL - JavaScript Tutorial

From the course: JavaScript: Ajax and Fetch

Start my 1-month free trial

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…

Contents