Skip to main content

@portkey/request

Introduction

Installation

npm install @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
},
});