http-easy
is a lightweight Node.js package that simplifies making HTTP requests with ease.
- Promise-based: Uses Promises for handling asynchronous operations, allowing for easy chaining and error handling.
- Flexible Configuration: Ability to configure request headers, timeouts, and other options.
- Error Handling: Comprehensive error handling with meaningful error messages.
- Support for Common HTTP Methods: GET, POST, PUT, DELETE, etc.
- Support for Query Parameters and Request Body: Convenient methods for adding query parameters and request body data.
- Interceptors: Middleware-like functionality for intercepting and modifying requests and responses.
npm install http-easy
const HttpEasy = require('http-easy');
const http = new HttpEasy();
// Making a GET request
http.get('https://jsonplaceholder.typicode.com/posts/1')
.then(response => {
console.log(response);
})
.catch(error => {
console.error(error);
});
For more examples and detailed usage, please refer to the documentation.
For the full API documentation and usage examples, please refer to the documentation.
Contributions are welcome! Please feel free to open an issue or submit a pull request for any feature or bug fix.
http-easy
is licensed under the Apache License 2.0. See the LICENSE file for details.