0.1.0 • Published 2 years ago

@oyohim/quester v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

@oYoHim/Quester

npm GitHub

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.

0.1.0

2 years ago