UNPKG

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