> For the complete documentation index, see [llms.txt](https://shinyobjectlabs.gitbook.io/framework-js/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shinyobjectlabs.gitbook.io/framework-js/fetch-examples/get.md).

# Get

```javascript
function fetchData() {
    // Use the Fetch API to make a GET request to a specific URL
    fetch('https://jsonplaceholder.typicode.com/todos/')
        .then((response) => {
            // Check if the response was OK
            if (!response.ok) {
                // If not, throw an error
                throw new Error('Network response was not OK');
            }
            // If the response was OK, parse the response as JSON
            return response.json();
        })
        .then((data) => {
            // Log the response
            console.log('Response', data)
        })
        .catch((error) => {
            // Log any network errors that occur
            console.error('There has been a problem with your fetch operation:', error);
        });
}
```
