simplerestapi

1.0.5 • Public • Published

simplerestapi

A simple and simplified request generator.

API Reference

How to use

const {petitionType} = require("simplerestapi");

petitionType("API","method","data")

//Examples

const { petitionType, petitionTypeAuth } = require('simplerestapi');

// Example 1: Making a basic HTTP request
const apiUrl = 'https://api.example.com/data';
const requestData = { key: 'value' };

petitionType(apiUrl, 'GET', requestData);

// Example 2: Making an authenticated HTTP request
const authApiUrl = 'https://api.example.com/authenticated-data';
const authData = { username: 'exampleUser', password: 'secretPassword' };
const authToken = 'Bearer YOUR_ACCESS_TOKEN';

petitionTypeAuth(authApiUrl, 'POST', authData, authToken);
Parameter Type Description
petitionType string string string Generates the API request
petitionTypeAuth string type string string Generates API request but with token access

Package Sidebar

Install

npm i simplerestapi

Weekly Downloads

3

Version

1.0.5

License

ISC

Unpacked Size

2.31 kB

Total Files

3

Last publish

Collaborators

  • aspad89