| 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 预先设置内容类型。重要! 此方法已弃用。它只能访问此事务的第一个文件。建议改用 SetFileContent() 方法。 |
| SetStringContent(string content, ContentEncoding contentEncoding?, string mediaType?); | 初始化基于字符串的 HTTP 请求。默认情况下,Content-Type 被设置为使用 UTF-8 编码的 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); |