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: {"Authorization": "basic AS0978FASLKLJA/=="},
method: 'POST',
postData: someObject,
multipart: false
});

or multipart post as:

let formData = new FormData();
formData.append("Authorization": "basic AS0978FASLKLJA/==");
await httpService.performRequest({
url: 'https://some.domain/path',
allowAutoRedirect: false,
method: 'POST',
postData: formData,
multipart: true
});

Hierarchy

  • HttpService

Constructors

Properties

aftCfg: AftConfig

Methods

  • issues a request over http / https and returns 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: {"Authorization": "basic AS0978FASLKLJA/=="},
    method: 'POST',
    postData: someObject,
    multipart: false
    });

    or multipart post as:

    let formData = new FormData();
    formData.append("Authorization": "basic AS0978FASLKLJA/==");
    await httpService.performRequest({
    url: 'https://some.domain/path',
    allowAutoRedirect: false,
    method: 'POST',
    postData: formData,
    multipart: true
    });

    Parameters

    • Optional req: HttpRequest

      a HttpResponse object that specifies details of the request

    Returns Promise<HttpResponse>

Generated using TypeDoc