1 | ;
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const expect = require("@fantasticfiasco/expect");
|
4 | const request = require("request");
|
5 | class HttpClient {
|
6 | get(url) {
|
7 | expect.toExist(url);
|
8 | return new Promise((resolve, reject) => {
|
9 | request.get(url, undefined, (error, _, body) => {
|
10 | if (error) {
|
11 | reject(error);
|
12 | }
|
13 | else {
|
14 | resolve(body);
|
15 | }
|
16 | });
|
17 | });
|
18 | }
|
19 | }
|
20 | exports.HttpClient = HttpClient;
|
21 | //# sourceMappingURL=HttpClient.js.map |
\ | No newline at end of file |