@luckbox/http-adapter-factory
TypeScript icon, indicating that this package has built-in type declarations

1.4.0 • Public • Published

Build Status

Coverage Status

Http Adapter Factory

A factory producing http adapters with different(in the near future) underlying library implementations.

Usage

import HttpAdapterFactory from '@luckbox/http-adapter-factory';

const httpAdapterFactory = new HttpAdapterFactory();
const httpAdapter = httpAdapterFactory.create({
  timeout: 10000
});

/* ... */
await httpAdapter.get('http://example.com', { bar: 'foo '});
await httpAdapter.post('http://example.com', {
  email: 'user@exampke.com',
  password: '123456'
});
await httpAdapter.delete('http://example.com/123');
await httpAdapter.patch('http://example.com/123', {
  bar: 'user@exampke.com',
});
await httpAdapter.put('http://example.com/123', {
  bar: 'user@exampke.com',
});

Supported implementations:

Currently, only one request library is supported - got

Readme

Keywords

none

Package Sidebar

Install

npm i @luckbox/http-adapter-factory

Weekly Downloads

0

Version

1.4.0

License

ISC

Unpacked Size

95.7 kB

Total Files

24

Last publish

Collaborators

  • ttecss
  • zupper