RequestPrepareOptions interface

屬性

abortSignal
baseUrl

要求的基底 URL。 預設值為:「 https://management.azure.com" ;。 這僅適用于 pathTemplate。 如果您要提供 options.url,則您預期會提供完整的 URL。

body

要求本文。 它可以是任何類型的。 如果此值不是資料流程,則會序列化此值。

bodyIsStream

指出要求本文是否為數據流, (適用于檔案上傳案例) 。

deserializationMapper

提供有關如何還原序列化回應本文的資訊。

disableClientRequestId

當設定為 true 時,會指示用戶端不要將 「x-ms-client-request-id」 標頭設定為新的 Guid () 。

disableJsonStringifyOnBody

指出這個方法是否應該 JSON.stringify () 要求本文。 預設值:false。

formData
headers

要求標頭的字典,需要套用至要求。 這裡的索引鍵是 「header-name」,而值是 「header-value」。 標頭值必須是字串類型。

  • ContentType 必須以索引鍵名稱提供為 「Content-Type」。 預設值 「application/json;charset=utf-8」。
  • 如果 「options.bodyIsStream」 設定為 true,預設會將 「Transfer-Encoding」 設定為 「區塊化」。
  • 如果 「options.bodyIsStream」 設定為 true,則 「Content-Type」 預設會設定為 「application/octet-stream」。
  • 預設會將 「accept-language」 設定為 「en-US」
  • 根據預設,「x-ms-client-request-id」 會設定為新的 Guid。 若要不產生要求的 GUID,請將 options.disableClientRequestId 設為 true
mappers

在 [de]序列化時可能使用的對應器的字典。

method

HTTP 要求方法。 有效值為 「GET」、「PUT」、「HEAD」、「DELETE」、「OPTIONS」、「POST」 或 「PATCH」。

onDownloadProgress
onUploadProgress
pathParameters

路徑參數的字典,必須以 pathTemplate 中的實際值取代。 這裡的索引鍵是 「path-parameter-name」,而此值是 「path-parameter-value」。 「path-parameter-value」 可以是 「string」 類型,也可以是 「object」 類型。 當您想要略過 URL 編碼時,應該使用 「object」 格式。 使用物件格式時,物件必須具有具名值的屬性,以提供 「path-parameter-value」。 範例:

  • path-parameter-value in 「object」 format: { 「path-parameter-name」: { value: 「path-parameter-value」, skipUrlEncoding: true } }
  • 「string」 格式為 path-parameter-value: { 「path-parameter-name」: 「path-parameter-value」 }。
pathTemplate

要求 URL 的路徑範本。 提供 「url」 或在 options 物件中提供 「pathTemplate」。 這兩個選項互斥。 範例:「/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}」

queryParameters

要附加至 URL 的查詢參數字典,其中 「key」 是 「query-parameter-name」,而 「value」 是 「query-parameter-value」。 「query-parameter-value」 可以是 「string」 類型,也可以是 「object」 類型。 當您想要略過 URL 編碼時,應該使用 「object」 格式。 使用物件格式時,物件必須具有名為 value 的屬性,以提供 「query-parameter-value」。 範例:

  • 「object」 格式的 query-parameter-value: { 「query-parameter-name」: { value: 「query-parameter-value」, skipUrlEncoding: true } }
  • 「string」 格式的 query-parameter-value: { 「query-parameter-name」: 「query-parameter-value」}。 注意:「如果 options.url 已經有一些查詢參數,則 options.queryParameters 中提供的值將會附加至 URL。
redirectLimit

限制此要求所遵循的重新導向數目。 如果設定為 0,將不會遵循重新導向。 如果保留未定義,則會套用基礎node_fetch的預設重新導向行為。

serializationMapper

提供有關如何序列化要求本文的資訊。

streamResponseBody
url

要求 URL。 它可能或可能沒有查詢參數。 提供 「url」 或在 options 物件中提供 「pathTemplate」。 這兩個選項互斥。

屬性詳細資料

abortSignal

abortSignal?: AbortSignalLike

屬性值

baseUrl

要求的基底 URL。 預設值為:「 https://management.azure.com" ;。 這僅適用于 pathTemplate。 如果您要提供 options.url,則您預期會提供完整的 URL。

baseUrl?: string

屬性值

string

body

要求本文。 它可以是任何類型的。 如果此值不是資料流程,則會序列化此值。

body?: any

屬性值

any

bodyIsStream

指出要求本文是否為數據流, (適用于檔案上傳案例) 。

bodyIsStream?: boolean

屬性值

boolean

deserializationMapper

提供有關如何還原序列化回應本文的資訊。

deserializationMapper?: object

屬性值

object

disableClientRequestId

當設定為 true 時,會指示用戶端不要將 「x-ms-client-request-id」 標頭設定為新的 Guid () 。

disableClientRequestId?: boolean

屬性值

boolean

disableJsonStringifyOnBody

指出這個方法是否應該 JSON.stringify () 要求本文。 預設值:false。

disableJsonStringifyOnBody?: boolean

屬性值

boolean

formData

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

屬性值

{[key: string]: any}

headers

要求標頭的字典,需要套用至要求。 這裡的索引鍵是 「header-name」,而值是 「header-value」。 標頭值必須是字串類型。

  • ContentType 必須以索引鍵名稱提供為 「Content-Type」。 預設值 「application/json;charset=utf-8」。
  • 如果 「options.bodyIsStream」 設定為 true,預設會將 「Transfer-Encoding」 設定為 「區塊化」。
  • 如果 「options.bodyIsStream」 設定為 true,則 「Content-Type」 預設會設定為 「application/octet-stream」。
  • 預設會將 「accept-language」 設定為 「en-US」
  • 根據預設,「x-ms-client-request-id」 會設定為新的 Guid。 若要不產生要求的 GUID,請將 options.disableClientRequestId 設為 true
headers?: {[key: string]: any}

屬性值

{[key: string]: any}

mappers

在 [de]序列化時可能使用的對應器的字典。

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

屬性值

{[x: string]: any}

method

HTTP 要求方法。 有效值為 「GET」、「PUT」、「HEAD」、「DELETE」、「OPTIONS」、「POST」 或 「PATCH」。

method: HttpMethods

屬性值

onDownloadProgress

onDownloadProgress?: (progress: TransferProgressEvent) => void

屬性值

(progress: TransferProgressEvent) => void

onUploadProgress

onUploadProgress?: (progress: TransferProgressEvent) => void

屬性值

(progress: TransferProgressEvent) => void

pathParameters

路徑參數的字典,必須以 pathTemplate 中的實際值取代。 這裡的索引鍵是 「path-parameter-name」,而此值是 「path-parameter-value」。 「path-parameter-value」 可以是 「string」 類型,也可以是 「object」 類型。 當您想要略過 URL 編碼時,應該使用 「object」 格式。 使用物件格式時,物件必須具有具名值的屬性,以提供 「path-parameter-value」。 範例:

  • path-parameter-value in 「object」 format: { 「path-parameter-name」: { value: 「path-parameter-value」, skipUrlEncoding: true } }
  • 「string」 格式為 path-parameter-value: { 「path-parameter-name」: 「path-parameter-value」 }。
pathParameters?: {[key: string]: any | ParameterValue}

屬性值

{[key: string]: any | ParameterValue}

pathTemplate

要求 URL 的路徑範本。 提供 「url」 或在 options 物件中提供 「pathTemplate」。 這兩個選項互斥。 範例:「/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}」

pathTemplate?: string

屬性值

string

queryParameters

要附加至 URL 的查詢參數字典,其中 「key」 是 「query-parameter-name」,而 「value」 是 「query-parameter-value」。 「query-parameter-value」 可以是 「string」 類型,也可以是 「object」 類型。 當您想要略過 URL 編碼時,應該使用 「object」 格式。 使用物件格式時,物件必須具有名為 value 的屬性,以提供 「query-parameter-value」。 範例:

  • 「object」 格式的 query-parameter-value: { 「query-parameter-name」: { value: 「query-parameter-value」, skipUrlEncoding: true } }
  • 「string」 格式的 query-parameter-value: { 「query-parameter-name」: 「query-parameter-value」}。 注意:「如果 options.url 已經有一些查詢參數,則 options.queryParameters 中提供的值將會附加至 URL。
queryParameters?: {[key: string]: any | ParameterValue}

屬性值

{[key: string]: any | ParameterValue}

redirectLimit

限制此要求所遵循的重新導向數目。 如果設定為 0,將不會遵循重新導向。 如果保留未定義,則會套用基礎node_fetch的預設重新導向行為。

redirectLimit?: number

屬性值

number

serializationMapper

提供有關如何序列化要求本文的資訊。

serializationMapper?: Mapper

屬性值

streamResponseBody

streamResponseBody?: boolean

屬性值

boolean

url

要求 URL。 它可能或可能沒有查詢參數。 提供 「url」 或在 options 物件中提供 「pathTemplate」。 這兩個選項互斥。

url?: string

屬性值

string