| SetHeader(string name, string value); | 設定此要求的額外 HTTP 標頭。應針對每個標頭名稱呼叫此方法。 |
| Send(); | 傳送 HTTP 要求。 |
| SetFileContent(DocumentExportResult documentExportResult, string mediaType?); | 初始化以流程為基礎的 HTTP 要求,允許將匯出的資料作為檔案傳遞。所傳遞內容的類型會根據匯出檔案的副檔名自動設定,例如 application/json、application/pdf。如有需要,可以使用選用參數 mediaType 預先設定內容類型。 |
| SetFileContent(BinaryFile binaryFile, string mediaType?); | 初始化以二進位資料為基礎的 HTTP 要求,可傳遞在建立處理作業時匯入的來源影像檔,或類型為 Picture 的欄位中所包含的影像。所傳遞內容的類型會根據匯入檔案的副檔名自動設定。如有需要,可以使用選用參數 mediaType 預先設定內容類型。 |
| SetSourceFileContent(string mediaType?); | 初始化以二進位資料為基礎的 HTTP 要求,允許傳遞在建立處理作業時匯入的來源影像檔。所傳遞內容的類型會根據匯入檔案的副檔名自動設定。如有需要,可以使用選用參數 mediaType 預先設定內容類型。重要! 此方法已標記為過時 (deprecated)。它只能存取處理作業中的第一個檔案。您應改用 SetFileContent() 方法。 |
| SetStringContent(string content, ContentEncoding contentEncoding?, string mediaType?); | 初始化以 string 為基礎的 HTTP 要求。預設情況下,Content-Type 會設為使用 UTF8 編碼的 application/json。如有需要,您可以變更內容和編碼類型。 |
| SetUrlFormEncodedContent(any content); | 初始化以 JavaScript 物件為基礎的要求內容,並將其編碼為 application/x-www-form-urlencoded。JavaScript 物件應初始化為一組簡單的屬性值,例如:var form = {}; form.grant_type = "password"; form.scope = "openid permissions"; form.client_id = "value of client_id"; form.client_secret = "value of client_secret"; form.password = "Password"; form.username = "User Name"; request.SetUrlFormEncodedContent(form); |