#### Table of Contents - [[#Using the Fetch API]] - [[]] - [[]] - [[]] ### Using the Fetch API The [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) provides a JavaScript interface for accessing and manipulating parts of the HTTP pipeline, such as requests and responses. It also provides a global [`fetch()`](https://developer.mozilla.org/en-US/docs/Web/API/fetch) method that provides an easy, logical way to fetch resources asynchronously across the network. This kind of functionality was previously achieved using [`XMLHttpRequest`](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest). Fetch provides a better alternative that can be easily used by other technologies such as [`Service Workers`](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API "Service Workers"). Fetch also provides a single logical place to define other HTTP-related concepts such as [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) and extensions to HTTP. ###### More info - [Using `fetch()` - MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch) - [`then()` - MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) - [Response methods - MDN](https://developer.mozilla.org/en-US/docs/Web/API/Response#Methods) - [Sending a request with credentials included - MDN](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#Sending_a_request_with_credentials_included) - [Sending cookies with fetch()](https://github.com/github/fetch#sending-cookies) - [Dog API](https://dog.ceo/dog-api/) ___ **Tags**: #fetch #promises