http/docs/readme.md

14 lines
1.1 KiB
Markdown
Raw Permalink Normal View History

2019-03-24 10:40:04 +00:00
# Introduction
HTTP module for Nuxt.js provides a universal way to make HTTP requests to the API backend.
2019-04-20 19:14:36 +00:00
This module is an alternative to [Axios Module](https://github.com/nuxt-community/axios-module). Behind the scenes it use [ky-universal](https://github.com/sindresorhus/ky-universal) and [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) to make HTTP requests. Please see the [migration guide](./guide/migration) if you are currently using axios module and wish to migrate.
2019-04-09 09:30:31 +00:00
Starting from [v2.5.0](https://github.com/nuxt/nuxt.js/releases/tag/v2.5.0), Nuxt.js has built-in support for universal fetch. However, this module provides several advantages:
2019-04-09 09:30:31 +00:00
2019-04-10 10:10:03 +00:00
- The fluent [ky](https://github.com/sindresorhus/ky) API has been extended with enhancements and shortcuts
- Highly customizable options support for [`BaseURL`](/api/#baseurl)
2019-04-09 09:30:31 +00:00
- Automatically proxy cookies and headers when making requests from server side
2019-04-10 10:10:03 +00:00
- Best practices to avoid token sharing when making server side requests
2019-04-09 09:30:31 +00:00
- Easy proxy support to avoid CORS problems and making deployment easier