mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-14 18:13:54 +00:00
9a0fc57724
Co-authored-by: Sébastien Chopin <seb@nuxtjs.com> Co-authored-by: pooya parsa <pyapar@gmail.com>
681 B
681 B
$fetch
::ReadMore{link="/guide/features/data-fetching"} ::
Nuxt uses 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 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 and @nuxtjs/axios that are made for Nuxt 2.
::NeedContribution ::