From the course: Introduction to Web APIs

Unlock the full course today

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

Parse data

Parse data

- [Instructor] You really don't need to be too concerned with this but it can be helpful to understand a little more what's happening with our response data. Later, when we look at code to make a request and work with the response data, you'll see that we need to write code to convert the data to JSON and you may wonder why. When data is sent in the response, it's typically sent as a string or readable stream depending on the method we use to send the request. We can think of the Data like a package being sent from the server to us and a string or readable stream is often the best, easiest way to send it. But in order to work with the data in JavaScript, we're going to want to convert it to JSON. This is kind of like opening the package, often referred to as parsing. In the next chapter, you'll learn about one way to make an API request that's abbreviated as XHR. With this type of request, the response data will be sent as…

Contents