@aravindhasamy/apihandler
v1.0.1
Published
The apiRequest function is a flexible utility designed to handle HTTP requests of various types, including GET, POST, PATCH, and DELETE. It supports making API calls to external services, handling different response types, and customizing request headers
Downloads
10
Maintainers
Keywords
Readme
@aravindhasamy/apihandler
@aravindhasamy/apihandler is a flexible utility to handle HTTP requests of various types, including GET, POST, PATCH, and DELETE. It supports making API calls to external services, handling different response types, and customizing request headers and body content.
Description
The apiRequest function within this package can be used for:
- Sending HTTP requests of various methods (GET, POST, PATCH, DELETE).
- Handling headers like Authorization (Bearer token), custom headers, and Content-Type.
- Sending request bodies for POST and PATCH methods.
- Handling query parameters, network errors, and structured error messages.
Features
- Supports HTTP methods: GET, POST, PATCH, DELETE
- Flexible API calls: Includes handling Authorization headers, custom headers, content-type headers, and request bodies.
- Error Handling: Provides structured error messages for network errors.
- File Handling: Handle content like images, PDFs, etc.
Installation
You can install the @aravindhasamy/apihandler package using npm:
npm install @aravindhasamy/apihandler