From the course: JavaScript for Web Designers

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Mocking up an API request

Mocking up an API request

- [Instructor] We have one main chunk of work to do. Query the Bing Maps API for the data and act upon it. We're going to cut that chunk in half. For this video, we'll write out making a query and acting upon its data. Instead of using Bing Maps right away, we're going to mock up the request so we can just focus on our page behavior, then we'll handle real data in the next step. To make the request, we're going to employ a JavaScript library that makes HTTP requests easy to make and easy to handle the data they return. The library we'll be using is called Axios. It makes working with RESTful APIs, in other words APIs that you interact with through regular web requests, much more pleasant. It's a small and focused library that I use a lot. You could also use JavaScript's built-in fetch method if you prefer. It's available in all current browsers. I just find using Axios to be nice enough that it's worth installing.…

Contents