IConversations.UploadAttachmentWithHttpMessagesAsync 方法

定义

重载

UploadAttachmentWithHttpMessagesAsync(String, AttachmentData, Dictionary<String,List<String>>, CancellationToken)
UploadAttachmentWithHttpMessagesAsync(String, AttachmentData, Dictionary<String,List<String>>, CancellationToken)

UploadAttachment。

UploadAttachmentWithHttpMessagesAsync(String, AttachmentData, Dictionary<String,List<String>>, CancellationToken)

public System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Microsoft.Bot.Connector.ResourceResponse>> UploadAttachmentWithHttpMessagesAsync (string conversationId, Microsoft.Bot.Connector.AttachmentData attachmentUpload, System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<string>> customHeaders = default, System.Threading.CancellationToken cancellationToken = default);
abstract member UploadAttachmentWithHttpMessagesAsync : string * Microsoft.Bot.Connector.AttachmentData * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Microsoft.Bot.Connector.ResourceResponse>>
Public Function UploadAttachmentWithHttpMessagesAsync (conversationId As String, attachmentUpload As AttachmentData, Optional customHeaders As Dictionary(Of String, List(Of String)) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of HttpOperationResponse(Of ResourceResponse))

参数

conversationId
String
attachmentUpload
AttachmentData
customHeaders
Dictionary<String,List<String>>
cancellationToken
CancellationToken

返回

Task<Microsoft.Rest.HttpOperationResponse<ResourceResponse>>

适用于

UploadAttachmentWithHttpMessagesAsync(String, AttachmentData, Dictionary<String,List<String>>, CancellationToken)

UploadAttachment。

public System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Microsoft.Bot.Schema.ResourceResponse>> UploadAttachmentWithHttpMessagesAsync (string conversationId, Microsoft.Bot.Schema.AttachmentData attachmentUpload, System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<string>> customHeaders = default, System.Threading.CancellationToken cancellationToken = default);
abstract member UploadAttachmentWithHttpMessagesAsync : string * Microsoft.Bot.Schema.AttachmentData * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Microsoft.Bot.Schema.ResourceResponse>>
Public Function UploadAttachmentWithHttpMessagesAsync (conversationId As String, attachmentUpload As AttachmentData, Optional customHeaders As Dictionary(Of String, List(Of String)) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of HttpOperationResponse(Of ResourceResponse))

参数

conversationId
String

对话 ID。

attachmentUpload
AttachmentData

附件数据。

customHeaders
Dictionary<String,List<String>>

将添加到请求的标头。

cancellationToken
CancellationToken

取消标记。

返回

Task<Microsoft.Rest.HttpOperationResponse<ResourceResponse>>

表示 Microsoft.Rest.HttpOperationResponse的任务。

例外

当操作返回无效状态代码时引发。

Microsoft.Rest.SerializationException

当无法反序列化响应时引发。

Microsoft.Rest.ValidationException

当所需参数为 null 时引发。

注解

将附件直接上传到通道的 Blob 存储中。

这很有用,因为它允许你在处理企业时将数据存储在合规的存储中。

响应是 ResourceResponse,其中包含适合与附件 API 一起使用的 AttachmentId。

适用于