Interface: IMTLSClient

Interface definition for the mTLS Client.

Table of contents

Methods

Methods

delete

delete(url, headers?, body?, options?): Promise<MTLSResponse>

Performs a mTLS delete request using the configured client certificate + key.

Parameters

Name Type Description
url string  
headers? Header  
body? any  
options? MTLSOptions Request specific options

Returns

Promise<MTLSResponse>


get

get(url, headers?, body?, options?): Promise<MTLSResponse>

Performs a mTLS get request using the configured client certificate + key

Parameters

Name Type Description
url string  
headers? Header  
body? any  
options? MTLSOptions Request specific options

Returns

Promise<MTLSResponse>


head(url, headers?, options?): Promise<MTLSResponse>

Performs a mTLS head request using the configured client certificate + key. Any body returned by the endpoint will be ignored and forcefully overridden with undefined.

Parameters

Name Type Description
url string  
headers? Header  
options? MTLSOptions Request specific options

Returns

Promise<MTLSResponse>


options

options(url, headers?, options?): Promise<MTLSResponse>

Performs a mTLS options request using the configured client certificate + key. Any body returned by the endpoint will be ignored and forcefully overridden with undefined.

Parameters

Name Type Description
url string  
headers? Header  
options? MTLSOptions Request specific options

Returns

Promise<MTLSResponse>


patch

patch(url, headers?, body?, options?): Promise<MTLSResponse>

Performs a mTLS put request using the configured client certificate + key.

Parameters

Name Type Description
url string  
headers? Header  
body? any  
options? MTLSOptions Request specific options

Returns

Promise<MTLSResponse>


post

post(url, headers?, body?, options?): Promise<MTLSResponse>

Performs a mTLS post request using the configured client certificate + key.

Parameters

Name Type Description
url string  
headers? Header  
body? any  
options? MTLSOptions Request specific options

Returns

Promise<MTLSResponse>


put

put(url, headers?, body?, options?): Promise<MTLSResponse>

Performs a mTLS put request using the configured client certificate + key.

Parameters

Name Type Description
url string  
headers? Header  
body? any  
options? MTLSOptions Request specific options

Returns

Promise<MTLSResponse>


Interface: MTLSResponse

Properties:

  • headers: [key: string]: string
  • statusCode: number
  • Optional body: any

Interface: MTLSOptions

Properties:

  • Optional allowSelfSigned: boolean

To ignore errors raised by self-signed certificates on the called endpoint. Alternatively you can provide the ca-cert as part of the clientTLS config.

  • Optional json: boolean

Set this flag to true, to automatically stringify body + set correct content header and parse response to json.

  • Optional timeout: number

Time in ms until request should timeout. Please be aware that mTLS calls take longer than regular HTTP calls.

Interface: Header

Properties:

  • [name: string]: string

Interface: ClientTLS

Properties:

  • Optional ca: string | Buffer

Certificate of the CA, this is relevant when endpoint that is called has a self-signed certificate. The certificate needs to be in PEM format.

CLient Certificate in PEM format.

Client Key in PEM format.