httpService: HttpService = ...

supports performing requests over http / https returning the response as a HttpResponse object. Requests should include a URL at a minimum, but may also specify additional details such as headers, auto redirect, post data and the request method (GET|POST|PUT|DELETE|UPDATE) ex:

await httpService.performRequest({url: 'https://some.domain/path'});

or fully as:

await httpService.performRequest({
url: 'https://some.domain/path',
allowAutoRedirect: false,
headers: {...HttpHeaders.Authorization.basic('myUser', 'myPass')},
method: 'POST',
postData: someObject,
multipart: false
});

or multipart post as:

let formData = new FormData();
formData.append('file', fs.createReadStream('/path/to/file.ext'));
await httpService.performRequest({
url: 'https://some.domain/path',
allowAutoRedirect: false,
headers: {...HttpHeaders.Authorization.basic('myUser', 'myPass')}
method: 'POST',
postData: formData,
multipart: true
});

Generated using TypeDoc