axioslisted
Install: claude install-skill claude-dev-suite/claude-dev-suite
# Axios - Quick Reference
## When to Use This Skill
- HTTP requests in JavaScript/TypeScript applications
- Configuring interceptors for auth/error handling
- Creating Axios instances for specific APIs
- Request/response transformation
- File uploads and downloads
> **Deep Knowledge**: Use `mcp__documentation__fetch_docs` with technology: `axios` for comprehensive documentation.
## Setup Base
```bash
npm install axios
```
## Pattern Essenziali
### GET Request
```typescript
import axios from 'axios';
const response = await axios.get('/api/users');
const users = response.data;
// With params
const response = await axios.get('/api/users', {
params: { page: 1, limit: 10 }
});
```
### POST Request
```typescript
const response = await axios.post('/api/users', {
name: 'John',
email: 'john@example.com'
});
```
### Axios Instance
```typescript
const api = axios.create({
baseURL: 'https://api.example.com',
timeout: 10000,
headers: { 'Content-Type': 'application/json' }
});
// Use instance
const users = await api.get('/users');
```
### Interceptors
```typescript
// Request interceptor (add auth token)
api.interceptors.request.use(
(config) => {
const token = localStorage.getItem('token');
if (token) {
config.headers.Authorization = `Bearer ${token}`;
}
return config;
},
(error) => Promise.reject(error)
);
// Response interceptor (handle errors)
api.interceptors.response.use(
(response) => response,
(error) => {
if (error.respo