Files
pos-system/packages/http-client/README.md
Ho Ngoc Hai 4da46b5b8e Sure! Pl
2025-12-27 01:31:10 +07:00

27 lines
526 B
Markdown

# @goodgo/http-client
HTTP client wrapper with Axios, automatic token management, and error handling.
## Usage
```typescript
import { createHttpClient } from '@goodgo/http-client';
const client = createHttpClient({
baseURL: 'http://api.example.com',
timeout: 30000,
});
// GET request
const response = await client.get('/users');
// POST request
const result = await client.post('/auth/login', {
email: 'user@example.com',
password: 'password',
});
// Set auth token
client.setAuthToken('your-token-here');
```