axiosの型メモ

created 2021/12/20updated 2021/12/20

axios/index.d.ts at 6b4fd93e6886c281ef1a51fca556616ce17f8fba · axios/axios

ts
import axios, { AxiosRequestConfig } from 'axios'; const requestParam: AxiosRequestConfig = { method: 'get', url: `${process.env.NEXT_PUBLIC_API_ENDPOINT}/users`, headers: { Authorization: `Bearer ${accessToken}`, }, }; const { data }: any = await axios(requestParam);