hwhttp5framework

1.0.0 • Public • Published

httpRequestWrapper

Introduction

This library provides a simple yet powerful wrapper for making HTTP requests in JavaScript. It simplifies the process of sending requests and handling responses, making it easier to integrate HTTP functionality into your applications.

Installation

You can install httpRequestWrapper via npm or yarn:

npm install httpRequestWrapper

or

yarn add httpRequestWrapper

Usage

const { HttpRequest } = require('httpRequestWrapper');

// Create a new instance of HttpRequest
const request = new HttpRequest();

// Set up request options
const options = {
    url: 'https://api.example.com/data',
    method: 'GET',
    headers: {
        'Content-Type': 'application/json'
    }
};

// Send the request
request.send(options)
    .then(response => {
        console.log('Response:', response);
    })
    .catch(error => {
        console.error('Error:', error);
    });

API
HttpRequest
Methods
send(options): Sends an HTTP request with the provided options. Returns a Promise that resolves with the response data.
License
This project is licensed under the MIT License - see the LICENSE file for details.

Readme

Keywords

Package Sidebar

Install

npm i hwhttp5framework

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

2.91 kB

Total Files

3

Last publish

Collaborators

  • z110botz