1.4.0 • Published 10 months ago

@luckbox/http-adapter-factory v1.4.0

Weekly downloads
12
License
ISC
Repository
github
Last release
10 months ago

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

1.4.0

10 months ago

1.3.1

1 year ago

1.3.0

1 year ago

1.2.0

2 years ago

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago