@oyohim/quester
v0.1.0
Published
Simple http request framework for oyohim.
Downloads
0
Readme
@oYoHim/Quester
Simple http request framework for oyohim.
Because of current demand is get and post, so this package only support get and post.
Installation
npm install @oyohim/quester
# or use yarn
yarn add @oyohim/quester
Usage
import { Quester } from '@oyohim/quester';
import { AdapterAxios } from '@oyohim/adapter-axios';
const http = new Quester(AdapterAxios, {
baseURL: 'https://api.github.com',
headers: {
'Content-Type': 'application/json',
},
});
const respose = await http.get('/users/oyohimjs');
API
class Quester()
- adapter:
Quester.Adapter
- config:
Quester.Config
.get<T>()
:Promise<QuesterAdapterResponse<T>>
- url:
string
- config?:
Quester.Config
.post<T>()
:Promise<QuesterAdapterResponse<T>>
- url:
string
- config?:
Quester.Config
Adapter
Thanks
License
This project is licensed under the MIT License.