Another way to request external data is to use the JavaScript <code>fetch()</code> method. It is equivalent to XMLHttpRequest, but the syntax is considered easier to understand.
Here is the code for making a GET request to <code>/json/cats.json</code>
The first line is the one that makes the request. So, <code>fetch(URL)</code> makes a GET request to the URL specified. The method returns a Promise.
After a Promise is returned, if the request was successful, the <code>then</code> method is executed, which takes the response and converts it to JSON format.
The <code>then</code> method also returns a Promise, which is handled by the next <code>then</code> method. The argument in the second <code>then</code> is the JSON object you are looking for!
Now, it selects the element that will receive the data by using <code>document.getElementById()</code>. Then it modifies the HTML code of the element by inserting a string created from the JSON object returned from the request.
</section>
## Instructions
<sectionid='instructions'>
Update the code to create and send a "GET" request to the freeCodeCamp Cat Photo API. But this time, using the <code>fetch</code> method instead of <code>XMLHttpRequest</code>.
</section>
## Tests
<sectionid='tests'>
```yml
tests:
- text: Your code should make a GET request with <code>fetch</code>.