OCISDK/OCISDK/ObjectStorage/ObjectStorageClientAsync.cs
/// <summary>
/// Gets the pre-authenticated request for the bucket.
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Gets the pre-authenticated request for the bucket.
Gets the pre - authenticated request for the bucket .
public async Task<GetPreauthenticatedRequestResponse> GetPreauthenticatedRequest(GetPreauthenticatedRequestRequest request)
        {
            var uri = new Uri($"{GetEndPointNoneVersion(ObjectStorageServices.Bucket(request.NamespaceName, request.BucketName), this.Region)}/p/{request.ParId}");
            var httpRequestHeaderParam = new HttpRequestHeaderParam()
            {
                OpcClientRequestId = request.OpcClientRequestId
            };
            using (var webResponse = await this.RestClientAsync.Get(uri, httpRequestHeaderParam))
            using (var stream = webResponse.GetResponseStream())
            using (var reader = new StreamReader(stream))
            {
                var response = reader.ReadToEnd();
                return new GetPreauthenticatedRequestResponse()
                {
                    OpcRequestId = webResponse.Headers.Get("opc-request-id"),
                    OpcClientRequestId = webResponse.Headers.Get("opc-client-request-id"),
                    PreauthenticatedRequestSummary = JsonSerializer.Deserialize<PreauthenticatedRequestSummary>(response)
                };
            }
        }
public async Task < GetPreauthenticatedRequestResponse > GetPreauthenticatedRequest ( GetPreauthenticatedRequestRequest request ) { var uri = new Uri ( $" { GetEndPointNoneVersion ( ObjectStorageServices . Bucket ( request . NamespaceName , request . BucketName ) , this . Region ) } /p/ { request . ParId } " ) ; var httpRequestHeaderParam = new HttpRequestHeaderParam ( ) { OpcClientRequestId = request . OpcClientRequestId } ; using ( var webResponse = await this . RestClientAsync . Get ( uri , httpRequestHeaderParam ) ) using ( var stream = webResponse . GetResponseStream ( ) ) using ( var reader = new StreamReader ( stream ) ) { var response = reader . ReadToEnd ( ) ; return new GetPreauthenticatedRequestResponse ( ) { OpcRequestId = webResponse . Headers . Get ( " " ) , OpcClientRequestId = webResponse . Headers . Get ( " " ) , PreauthenticatedRequestSummary = JsonSerializer . Deserialize < PreauthenticatedRequestSummary > ( response ) } ; } }
Gets the pre-authenticated request for the bucket.
Gets the pre - authenticated request for the bucket .
None
request
GetPreauthenticatedRequestRequest
None