-
Notifications
You must be signed in to change notification settings - Fork 0
Introduction to fetch‐like‐axios
Welcome to the fetch-like-axios
wiki!
This project is designed to provide a lightweight, Axios-like wrapper for the native fetch
API, simplifying HTTP requests while maintaining full flexibility. Whether you need basic GET/POST requests, handle complex FormData uploads, or manage more advanced scenarios like interceptors, timeouts, and retries, fetch-like-axios
is built to offer you a familiar, easy-to-use interface.
fetch
is powerful and available natively in modern browsers, but when it comes to handling common scenarios like:
- Global error handling
- Request and response interceptors
- File uploads and FormData support
- Timeouts and retry mechanisms
... developers often find themselves writing repetitive code. That's where fetch-like-axios
steps in—offering a cleaner, more structured approach to building HTTP requests.
-
Easy Request Configuration: Supports all HTTP methods (
GET
,POST
,PUT
,DELETE
,PATCH
,HEAD
,OPTIONS
) with simple syntax. - FormData and File Upload: Seamless support for FormData and binary file uploads.
- Interceptors: Add request and response interceptors to handle data before it leaves or arrives.
- Timeouts and Retries: Manage long-running requests with timeout control and retry mechanisms.
-
Cancel Requests: Leverage
AbortController
to cancel ongoing requests. - Flexible Headers Management: Set global or request-specific headers effortlessly.
You can find the installation instructions, usage examples, and code snippets in the main README file here.
We also provide detailed examples in this wiki, starting with a basic setup and moving to more advanced use cases like interceptors, FormData uploads, and managing retries for failed requests.
We are constantly improving and adding new features to fetch-like-axios
. Some of the planned additions:
- Enhanced error handling options
- Better support for edge cases (e.g., file uploads, response streaming)
- Performance optimizations and bundle size reduction
Stay tuned for updates and feel free to contribute or suggest features in the issues section!