RestClientRequestParams interface
傳送 WebApi 要求的參數
屬性
| api |
要在要求中傳送的 API 版本字串 (例如 “1.0” 或 “2.0-preview.2”) |
| body | 要張貼的資料。 在此情況下,這是 GET ,這表示查詢參數。 對於其他請求,這是請求本文物件(除非isRawData設定為true,否則將序列化為JSON字串)。 |
| command | 活動記錄的現行命令。 這將覆蓋 RestClient 的基本選項。 |
| custom |
允許呼叫端指定自訂要求標頭。 |
| http |
http 回應 (Accept) 類型。 這是“json”(對應application/json Accept標頭),除非另有說明。 其他可能的值是 “html”、“text”、“zip” 或 “binary” 或它們接受的標頭等效項 (例如 application/zip)。 |
| is |
如果為true,則表示在要求中傳送「資料」物件之前,不應對其進行任何處理。 這很少需要。 一種情況是張貼 HTML5 檔案物件時。 |
| method | HTTP 動詞 (如果未指定,則預設為 GET) |
| query |
查詢要新增至 URL 的參數。 在 GET 的情況下,可以透過 'data' 或 'queryParams' 提供查詢參數。 對於其他動詞,例如 POST,資料物件會指定 POST 本文,因此需要 queryParams 來指示要新增至 url 查詢字串的參數 (不包含在 post 本文中)。 |
| return |
如果為 true,則表示應該在請求的產生 promise 中傳回原始 Response,而不是還原序列化回應 (預設值)。 |
| route |
用來形成要求路徑的路由範本。 如果未指定 routeTemplate,則會使用 locationId 透過 OPTIONS 要求來查閱範本。 |
| route |
路由範本取代值字典 |
屬性詳細資料
apiVersion
要在要求中傳送的 API 版本字串 (例如 “1.0” 或 “2.0-preview.2”)
apiVersion: string
屬性值
string
body
要張貼的資料。 在此情況下,這是 GET ,這表示查詢參數。 對於其他請求,這是請求本文物件(除非isRawData設定為true,否則將序列化為JSON字串)。
body?: any
屬性值
any
command
活動記錄的現行命令。 這將覆蓋 RestClient 的基本選項。
command?: string
屬性值
string
customHeaders
允許呼叫端指定自訂要求標頭。
customHeaders?: {[headerName: string]: any}
屬性值
{[headerName: string]: any}
httpResponseType
http 回應 (Accept) 類型。 這是“json”(對應application/json Accept標頭),除非另有說明。 其他可能的值是 “html”、“text”、“zip” 或 “binary” 或它們接受的標頭等效項 (例如 application/zip)。
httpResponseType?: string
屬性值
string
isRawData
如果為true,則表示在要求中傳送「資料」物件之前,不應對其進行任何處理。 這很少需要。 一種情況是張貼 HTML5 檔案物件時。
isRawData?: boolean
屬性值
boolean
method
HTTP 動詞 (如果未指定,則預設為 GET)
method?: string
屬性值
string
queryParams
查詢要新增至 URL 的參數。 在 GET 的情況下,可以透過 'data' 或 'queryParams' 提供查詢參數。 對於其他動詞,例如 POST,資料物件會指定 POST 本文,因此需要 queryParams 來指示要新增至 url 查詢字串的參數 (不包含在 post 本文中)。
queryParams?: {[key: string]: any}
屬性值
{[key: string]: any}
returnRawResponse
如果為 true,則表示應該在請求的產生 promise 中傳回原始 Response,而不是還原序列化回應 (預設值)。
returnRawResponse?: boolean
屬性值
boolean
routeTemplate
用來形成要求路徑的路由範本。 如果未指定 routeTemplate,則會使用 locationId 透過 OPTIONS 要求來查閱範本。
routeTemplate: string
屬性值
string
routeValues
路由範本取代值字典
routeValues?: {[key: string]: any}
屬性值
{[key: string]: any}