SearchIndexClient.UploadKnowledgeSourceFileMultipartAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| UploadKnowledgeSourceFileMultipartAsync(String, UploadKnowledgeSourceFileMultipartRequest, CancellationToken) |
Uploads a file to a File knowledge source using multipart/form-data: a JSON 'metadata' part (file name and custom metadata) and a 'content' part with the raw file bytes. |
| UploadKnowledgeSourceFileMultipartAsync(String, RequestContent, String, RequestContext) |
[Protocol Method] Uploads a file to a File knowledge source using multipart/form-data: a JSON 'metadata' part (file name and custom metadata) and a 'content' part with the raw file bytes.
|
UploadKnowledgeSourceFileMultipartAsync(String, UploadKnowledgeSourceFileMultipartRequest, CancellationToken)
- Source:
- SearchIndexClient.cs
Uploads a file to a File knowledge source using multipart/form-data: a JSON 'metadata' part (file name and custom metadata) and a 'content' part with the raw file bytes.
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Search.Documents.Indexes.Models.KnowledgeSourceFile>> UploadKnowledgeSourceFileMultipartAsync(string sourceName, Azure.Search.Documents.Indexes.Models.UploadKnowledgeSourceFileMultipartRequest body, System.Threading.CancellationToken cancellationToken = default);
abstract member UploadKnowledgeSourceFileMultipartAsync : string * Azure.Search.Documents.Indexes.Models.UploadKnowledgeSourceFileMultipartRequest * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Search.Documents.Indexes.Models.KnowledgeSourceFile>>
override this.UploadKnowledgeSourceFileMultipartAsync : string * Azure.Search.Documents.Indexes.Models.UploadKnowledgeSourceFileMultipartRequest * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Search.Documents.Indexes.Models.KnowledgeSourceFile>>
Public Overridable Function UploadKnowledgeSourceFileMultipartAsync (sourceName As String, body As UploadKnowledgeSourceFileMultipartRequest, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of KnowledgeSourceFile))
Parameters
- sourceName
- String
The name of the knowledge source.
The multipart/form-data body containing the metadata and content parts.
- cancellationToken
- CancellationToken
The cancellation token that can be used to cancel the operation.
Returns
Exceptions
sourceName or body is null.
sourceName is an empty string, and was expected to be non-empty.
Service returned a non-success status code.
Applies to
UploadKnowledgeSourceFileMultipartAsync(String, RequestContent, String, RequestContext)
- Source:
- SearchIndexClient.cs
[Protocol Method] Uploads a file to a File knowledge source using multipart/form-data: a JSON 'metadata' part (file name and custom metadata) and a 'content' part with the raw file bytes.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
public virtual System.Threading.Tasks.Task<Azure.Response> UploadKnowledgeSourceFileMultipartAsync(string sourceName, Azure.Core.RequestContent content, string contentType, Azure.RequestContext context = default);
abstract member UploadKnowledgeSourceFileMultipartAsync : string * Azure.Core.RequestContent * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.UploadKnowledgeSourceFileMultipartAsync : string * Azure.Core.RequestContent * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function UploadKnowledgeSourceFileMultipartAsync (sourceName As String, content As RequestContent, contentType As String, Optional context As RequestContext = Nothing) As Task(Of Response)
Parameters
- sourceName
- String
The name of the knowledge source.
- content
- RequestContent
The content to send as the body of the request.
- contentType
- String
The contentType to use which has the multipart/form-data boundary.
- context
- RequestContext
The request options, which can override default behaviors of the client pipeline on a per-call basis.
Returns
The response returned from the service.
Exceptions
sourceName, content or contentType is null.
sourceName or contentType is an empty string, and was expected to be non-empty.
Service returned a non-success status code.