OCISDK/OCISDK/ObjectStorage/ObjectStorageClientAsync.cs
/// <summary>
/// Starts a new multipart upload to a specific object in the given bucket in the given namespace.
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Starts a new multipart upload to a specific object in the given bucket in the given namespace.
Starts a new multipart upload to a specific object in the given bucket in the given namespace .
public async Task<CreateMultipartUploadResponse> CreateMultipartUpload(CreateMultipartUploadRequest request)
        {
            var uri = new Uri($"{GetEndPointNoneVersion(ObjectStorageServices.Bucket(request.NamespaceName, request.BucketName), this.Region)}/u");
            HttpRequestHeaderParam HttpRequestHeaderParam = new HttpRequestHeaderParam()
            {
                IfMatch = request.IfMatch,
                IfNoneMatch = request.IfNoneMatch,
                OpcClientRequestId = request.OpcClientRequestId
            };
            using (var webResponse = await this.RestClientAsync.Post(uri, request.CreateMultipartUploadDetails, HttpRequestHeaderParam))
            using (var stream = webResponse.GetResponseStream())
            using (var reader = new StreamReader(stream))
            {
                var response = reader.ReadToEnd();
                return new CreateMultipartUploadResponse()
                {
                    OpcRequestId = webResponse.Headers.Get("opc-request-id"),
                    OpcClientRequestId = webResponse.Headers.Get("opc-client-request-id"),
                    Location = webResponse.Headers.Get("Location")
                };
            }
        }
public async Task < CreateMultipartUploadResponse > CreateMultipartUpload ( CreateMultipartUploadRequest request ) { var uri = new Uri ( $" { GetEndPointNoneVersion ( ObjectStorageServices . Bucket ( request . NamespaceName , request . BucketName ) , this . Region ) } /u " ) ; HttpRequestHeaderParam HttpRequestHeaderParam = new HttpRequestHeaderParam ( ) { IfMatch = request . IfMatch , IfNoneMatch = request . IfNoneMatch , OpcClientRequestId = request . OpcClientRequestId } ; using ( var webResponse = await this . RestClientAsync . Post ( uri , request . CreateMultipartUploadDetails , HttpRequestHeaderParam ) ) using ( var stream = webResponse . GetResponseStream ( ) ) using ( var reader = new StreamReader ( stream ) ) { var response = reader . ReadToEnd ( ) ; return new CreateMultipartUploadResponse ( ) { OpcRequestId = webResponse . Headers . Get ( " " ) , OpcClientRequestId = webResponse . Headers . Get ( " " ) , Location = webResponse . Headers . Get ( " " ) } ; } }
Starts a new multipart upload to a specific object in the given bucket in the given namespace.
Starts a new multipart upload to a specific object in the given bucket in the given namespace .
None
request
CreateMultipartUploadRequest
None