小编Dan*_*des的帖子

Axios 可以在新的 next.js 13 中使用,而不是扩展的 next fetch api 版本吗?

  1. 大家好,我可以将 axios 与 next.js 13 一起使用,并且仍然获得带有缓存和重新验证配置的扩展 fetch api 版本的相同结果吗?

  2. axios 会走向这个网络标准的方向吗?

  3. 我真的很喜欢 axios.intereceptors 功能,我应该使用下一个中间件吗?

能给我 2 美分吗?

My first stackoverflow question, even coding for 2 years (still) ... please vote up so I can unlock the mid dev super powers tks

`export default async function Page() {
  // revalidate this data every 10 seconds at most
  const res = await **axios.get**('https://...', { next: { revalidate: 10, cache: 'force-cache' .... } });
  const data = res.json();
  // ...
}

// does …
Run Code Online (Sandbox Code Playgroud)

middleware web-standards fetch-api axios next.js13

10
推荐指数
2
解决办法
2万
查看次数

标签 统计

axios ×1

fetch-api ×1

middleware ×1

next.js13 ×1

web-standards ×1