ApiClient Guide
TheApiClient class provides a powerful, type-safe HTTP client with built-in retry logic, circuit breakers, localized error messages, and request/response interceptors.
Quick Start
Configuration Options
ApiClientConfig
Example Configuration
Making Requests
GET Requests
POST Requests
PUT and PATCH Requests
DELETE Requests
Paginated Lists
ThegetList method provides a structured way to handle paginated API responses:
Request Options
RequestOptions Interface
Advanced Request Options
Error Handling
ApiError Class
Handling Errors
Localized Error Messages
ByteKit provides built-in error messages in English and Spanish:| Status | English | Spanish |
|---|---|---|
| 400 | Invalid request. Please check your data. | La solicitud es inválida. Verifica los datos enviados. |
| 401 | You must be signed in to continue. | Necesitas iniciar sesión para continuar. |
| 403 | You don’t have permission for this action. | No tienes permisos para realizar esta acción. |
| 404 | Resource not found. | El recurso solicitado no fue encontrado. |
| 500 | Internal server error. | Ocurrió un error interno en el servidor. |