@portkey/request
Introduction
Installation
- NPM
- YARN
npm install @portkey/request
yarn add @portkey/request
Usage
import { IRequestDefaults } from '@portkey/types';
import { FetchRequest } from '@portkey/request';
const config: IRequestDefaults = {
// Your custom implementation here
}
const fetchRequest = new FetchRequest(config);
// send get request
fetchRequest.send({
method: 'GET',
url: 'your api',
})
// send post request
fetchRequest.send({
method: 'POST',
url: 'your api',
params: {
// your params
},
});