Zum Hauptinhalt springen

HttpClientConfig

HttpClientConfig = object

Http client config options used in HttpClient

Properties​

url?​

optional url: string

URL that will be used for the request


method?​

optional method: HTTPMethod

The request method to be used when making the request.

Currently supported Methods are:

  • "GET"
  • "POST"
  • "PUT"
  • "DELETE"

headers?​

optional headers: object

Custom headers to be sent

Index Signature​

[key: string]: string

content-type?​

optional content-type: HeaderContentType


data?​

optional data: HttpClientRequestData

Form-Data to be sent as the request body. This causes curl to POST data using the Content-Type multipart/form-data according to RFC 2388.


timeout?​

optional timeout: number

timeout in ms. Specifies the number of milliseconds before the request times out. If the request takes longer than timeout, the request will be aborted.

Default​

5000

auth?​

optional auth: object

auth indicates that HTTP Basic auth should be used, and supplies credentials.

username​

username: string

password​

password: string


followRedirects?​

optional followRedirects: boolean

Should follow request when HTTP reponse was 3xx

Default​

{true}

dryRun?​

optional dryRun: boolean

If this flag is true, no request will be trigger, only the requested url will be logged. (Optional)

Default​

{false}

ignoreSelfSignedCertificate?​

optional ignoreSelfSignedCertificate: boolean

If this flag is true, the request accepts self signed certifcates. If you got an curl (60) error, you should set this flag to true.

curl: (60) SSL certificate problem: self signed certificate in certificate chain More details here: https://curl.se/docs/sslcerts.html

Default​

{false}

downloadDestinationPath?​

optional downloadDestinationPath: string

If this is specified, request will download a file to the given path.


compressed?​

optional compressed: boolean

Set this flag if you expect the response to be compressed.

Default​

{false}