apiz-node-client
TypeScript icon, indicating that this package has built-in type declarations

4.0.2 • Public • Published

apiz-node-client

apiz-node-client implements the APIzClient interface for node, based on got, so you can use options of got.

Usage

import { APIz } from 'apiz-ng';
import apizClient from 'apiz-browser-client';
 
const apiMeta = {
    getBook: {
        url: 'http://www.a.com'
    }
};
 
const apis = new APIz(apiMeta, {
    client: apizClient({
        beforeRequest: [async options => console.log(options)],
        afterResponse: [response => console.log(response.statusCode)],
        retry: 3
    })
})

beforeRequest and afterResponse are hooks of got.

Readme

Keywords

Package Sidebar

Install

npm i apiz-node-client

Weekly Downloads

5

Version

4.0.2

License

MIT

Unpacked Size

21.7 kB

Total Files

8

Last publish

Collaborators

  • ta7sudan