Nuxt/docs/content/3.api/3.utils/$fetch.md
Clément Ollivier 9a0fc57724
docs: update sitemap (#4063)
Co-authored-by: Sébastien Chopin <seb@nuxtjs.com>
Co-authored-by: pooya parsa <pyapar@gmail.com>
2022-04-06 07:56:08 +02:00

14 lines
681 B
Markdown

# `$fetch`
::ReadMore{link="/guide/features/data-fetching"}
::
Nuxt uses [ohmyfetch](https://github.com/unjs/ohmyfetch) to expose globally the `$fetch` helper for making HTTP requests within you Vue app or API routes.
During server-side rendering, calling `$fetch` to fetch your internal [API routes](/guide/directory-structure/server) will directly call the relevant function (emulating the request), **saving an additional API call**.
Note that `$fetch` is the preferred way to make HTTP calls in Nuxt 3 instead of [@nuxt/http](https://github.com/nuxt/http) and [@nuxtjs/axios](https://github.com/nuxt-community/axios-module) that are made for Nuxt 2.
::NeedContribution
::