Skip to content

BinsSoft/httprequest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

httprequest

Support Support License

It is a HTTP request plugin with synchronize way.

Install

<script src="/path/to/HttpRequest.js"></script>

Implementation

Initialization

const  http = new  HttpRequest({
  'baseUrl':  'http://localhost:8000/api/v1/',
  'responseDataType':  'JSON'
});

API call

GET

const listApiCall = http.call('get-list-data', 'GET');
listApiCall.then((responseData)=>{

  ... do something ...

});

SET Headers

http.setHeader('x-access-token', '<token data>');
http.setHeader('Content-Type', '<content type>');

.... more on ...

POST

http.call('authentication', 'POST', null, JSON.stringify({
"email":"test@test.com",
"password":"test@123"
})).then((responseData)=>{

  ... do something ...

});

Creator

Tonmoy Nandy

License

The MIT License (MIT)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published