UNPKG

600 BMarkdownView Raw
1# http-transport
2
3> A flexible, modular REST client built for ease-of-use and resilience
4
5## Installation
6
7```
8npm install @bbc/http-transport --save
9```
10
11## Usage
12
13```js
14const url = 'http://example.com/';
15const client = require('@bbc/http-transport').createClient();
16
17const res = await client
18 .get(url)
19 .asResponse();
20
21 if (res.statusCode === 200) {
22 console.log(res.body);
23 }
24```
25
26## Documentation
27For more examples and API details, see [API documentation](https://bbc.github.io/http-transport)
28
29## Test
30
31```
32npm test
33```
34
35To generate a test coverage report:
36
37```
38npm run coverage
39```