RequestPrepareOptions interface

Properties

abortSignal
baseUrl

The base url of the request. Default value is: "https://management.azure.com". This is applicable only with pathTemplate. If you are providing options.url then it is expected that you provide the complete url.

body

The request body. It can be of any type. This value will be serialized if it is not a stream.

bodyIsStream

Indicates whether the request body is a stream (useful for file upload scenarios).

deserializationMapper

Provides information on how to deserialize the response body.

disableClientRequestId

When set to true, instructs the client to not set "x-ms-client-request-id" header to a new Guid().

disableJsonStringifyOnBody

Indicates whether this method should JSON.stringify() the request body. Default value: false.

formData
headers

A dictionary of request headers that need to be applied to the request. Here the key is the "header-name" and the value is the "header-value". The header-value MUST be of type string.

  • ContentType must be provided with the key name as "Content-Type". Default value "application/json; charset=utf-8".
  • "Transfer-Encoding" is set to "chunked" by default if "options.bodyIsStream" is set to true.
  • "Content-Type" is set to "application/octet-stream" by default if "options.bodyIsStream" is set to true.
  • "accept-language" by default is set to "en-US"
  • "x-ms-client-request-id" by default is set to a new Guid. To not generate a guid for the request, please set options.disableClientRequestId to true
mappers

A dictionary of mappers that may be used while [de]serialization.

method

The HTTP request method. Valid values are "GET", "PUT", "HEAD", "DELETE", "OPTIONS", "POST", or "PATCH".

onDownloadProgress
onUploadProgress
pathParameters

A dictionary of path parameters that need to be replaced with actual values in the pathTemplate. Here the key is the "path-parameter-name" and the value is the "path-parameter-value". The "path-parameter-value" can be of type "string" or it can be of type "object". The "object" format should be used when you want to skip url encoding. While using the object format, the object must have a property named value which provides the "path-parameter-value". Example:

  • path-parameter-value in "object" format: { "path-parameter-name": { value: "path-parameter-value", skipUrlEncoding: true } }
  • path-parameter-value in "string" format: { "path-parameter-name": "path-parameter-value" }.
pathTemplate

The path template of the request url. Either provide the "url" or provide the "pathTemplate" in the options object. Both the options are mutually exclusive. Example: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}"

queryParameters

A dictionary of query parameters to be appended to the url, where the "key" is the "query-parameter-name" and the "value" is the "query-parameter-value". The "query-parameter-value" can be of type "string" or it can be of type "object". The "object" format should be used when you want to skip url encoding. While using the object format, the object must have a property named value which provides the "query-parameter-value". Example:

  • query-parameter-value in "object" format: { "query-parameter-name": { value: "query-parameter-value", skipUrlEncoding: true } }
  • query-parameter-value in "string" format: { "query-parameter-name": "query-parameter-value"}. Note: "If options.url already has some query parameters, then the value provided in options.queryParameters will be appended to the url.
redirectLimit

Limit the number of redirects followed for this request. If set to 0, redirects will not be followed. If left undefined the default redirect behaviour of the underlying node_fetch will apply.

serializationMapper

Provides information on how to serialize the request body.

streamResponseBody
url

The request url. It may or may not have query parameters in it. Either provide the "url" or provide the "pathTemplate" in the options object. Both the options are mutually exclusive.

Property Details

abortSignal

abortSignal?: AbortSignalLike

Property Value

baseUrl

The base url of the request. Default value is: "https://management.azure.com". This is applicable only with pathTemplate. If you are providing options.url then it is expected that you provide the complete url.

baseUrl?: string

Property Value

string

body

The request body. It can be of any type. This value will be serialized if it is not a stream.

body?: any

Property Value

any

bodyIsStream

Indicates whether the request body is a stream (useful for file upload scenarios).

bodyIsStream?: boolean

Property Value

boolean

deserializationMapper

Provides information on how to deserialize the response body.

deserializationMapper?: object

Property Value

object

disableClientRequestId

When set to true, instructs the client to not set "x-ms-client-request-id" header to a new Guid().

disableClientRequestId?: boolean

Property Value

boolean

disableJsonStringifyOnBody

Indicates whether this method should JSON.stringify() the request body. Default value: false.

disableJsonStringifyOnBody?: boolean

Property Value

boolean

formData

formData?: {[key: string]: any}

Property Value

{[key: string]: any}

headers

A dictionary of request headers that need to be applied to the request. Here the key is the "header-name" and the value is the "header-value". The header-value MUST be of type string.

  • ContentType must be provided with the key name as "Content-Type". Default value "application/json; charset=utf-8".
  • "Transfer-Encoding" is set to "chunked" by default if "options.bodyIsStream" is set to true.
  • "Content-Type" is set to "application/octet-stream" by default if "options.bodyIsStream" is set to true.
  • "accept-language" by default is set to "en-US"
  • "x-ms-client-request-id" by default is set to a new Guid. To not generate a guid for the request, please set options.disableClientRequestId to true
headers?: {[key: string]: any}

Property Value

{[key: string]: any}

mappers

A dictionary of mappers that may be used while [de]serialization.

mappers?: {[x: string]: any}

Property Value

{[x: string]: any}

method

The HTTP request method. Valid values are "GET", "PUT", "HEAD", "DELETE", "OPTIONS", "POST", or "PATCH".

method: HttpMethods

Property Value

onDownloadProgress

onDownloadProgress?: (progress: TransferProgressEvent) => void

Property Value

(progress: TransferProgressEvent) => void

onUploadProgress

onUploadProgress?: (progress: TransferProgressEvent) => void

Property Value

(progress: TransferProgressEvent) => void

pathParameters

A dictionary of path parameters that need to be replaced with actual values in the pathTemplate. Here the key is the "path-parameter-name" and the value is the "path-parameter-value". The "path-parameter-value" can be of type "string" or it can be of type "object". The "object" format should be used when you want to skip url encoding. While using the object format, the object must have a property named value which provides the "path-parameter-value". Example:

  • path-parameter-value in "object" format: { "path-parameter-name": { value: "path-parameter-value", skipUrlEncoding: true } }
  • path-parameter-value in "string" format: { "path-parameter-name": "path-parameter-value" }.
pathParameters?: {[key: string]: any | ParameterValue}

Property Value

{[key: string]: any | ParameterValue}

pathTemplate

The path template of the request url. Either provide the "url" or provide the "pathTemplate" in the options object. Both the options are mutually exclusive. Example: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}"

pathTemplate?: string

Property Value

string

queryParameters

A dictionary of query parameters to be appended to the url, where the "key" is the "query-parameter-name" and the "value" is the "query-parameter-value". The "query-parameter-value" can be of type "string" or it can be of type "object". The "object" format should be used when you want to skip url encoding. While using the object format, the object must have a property named value which provides the "query-parameter-value". Example:

  • query-parameter-value in "object" format: { "query-parameter-name": { value: "query-parameter-value", skipUrlEncoding: true } }
  • query-parameter-value in "string" format: { "query-parameter-name": "query-parameter-value"}. Note: "If options.url already has some query parameters, then the value provided in options.queryParameters will be appended to the url.
queryParameters?: {[key: string]: any | ParameterValue}

Property Value

{[key: string]: any | ParameterValue}

redirectLimit

Limit the number of redirects followed for this request. If set to 0, redirects will not be followed. If left undefined the default redirect behaviour of the underlying node_fetch will apply.

redirectLimit?: number

Property Value

number

serializationMapper

Provides information on how to serialize the request body.

serializationMapper?: Mapper

Property Value

streamResponseBody

streamResponseBody?: boolean

Property Value

boolean

url

The request url. It may or may not have query parameters in it. Either provide the "url" or provide the "pathTemplate" in the options object. Both the options are mutually exclusive.

url?: string

Property Value

string