| 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 的 field 中包含的图像。传递内容类型会根据导入文件的扩展名自动设置。如有需要,可使用可选参数 mediaType 预先设置内容类型。 |
| SetSourceFileContent(string mediaType?); | 初始化基于二进制数据的 HTTP 请求,允许传递在创建处理事务时导入的源图像文件。传递内容类型会根据导入文件的扩展名自动设置。如有需要,可使用可选参数 mediaType 预先设置内容类型。**重要提示:**此方法已弃用。它只能访问该处理事务中的第一个文件。应改用 SetFileContent() 方法。 |
| SetStringContent(string content, ContentEncoding contentEncoding?, string mediaType?); | 初始化基于 string 的 HTTP 请求。默认情况下,Content-Type 设置为 application/json,字符编码为 UTF-8。如有需要,您可以更改内容类型和编码。 |
| 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); |