@aspida/axios
Getting Started
Installation
Make HTTP request from application
src/index.ts
import axios from "axios";
import aspida from "@aspida/axios";
import api from "../api/$api";
const axiosConfig = { timeout: 3000, baseURL: "https://example.com/api" };
const client = api(aspida(axios, axiosConfig));
(async () => {
const userId = 0;
const limit = 10;
await client.v1.users.post({ name: "mario" });
const res = await client.v1.users.get({ query: { limit } });
console.log(res);
const user = await client.v1.users._userId(userId).$get();
console.log(user);
})();
License
@aspida/axios is licensed under a MIT License.