Amazon.S3.AmazonS3Client.PostResponseHelper C# (CSharp) Method

PostResponseHelper() private method

private PostResponseHelper ( IAsyncResult result ) : void
result IAsyncResult
return void
        private void PostResponseHelper(IAsyncResult result)
        {
            IAsyncExecutionContext executionContext = result.AsyncState as IAsyncExecutionContext;
            IWebResponseData response = executionContext.ResponseContext.HttpResponse;
            RuntimeAsyncResult asyncResult = executionContext.ResponseContext.AsyncResult as RuntimeAsyncResult;

            if (executionContext.ResponseContext.AsyncResult.Exception == null)
            {
                PostObjectResponse postResponse = new PostObjectResponse();
                postResponse.HttpStatusCode = response.StatusCode;
                postResponse.ContentLength = response.ContentLength;

                if (response.IsHeaderPresent(HeaderKeys.XAmzRequestIdHeader))
                    postResponse.RequestId = response.GetHeaderValue(HeaderKeys.XAmzRequestIdHeader);
                if (response.IsHeaderPresent(HeaderKeys.XAmzId2Header))
                    postResponse.HostId = response.GetHeaderValue(HeaderKeys.XAmzId2Header);
                if (response.IsHeaderPresent(HeaderKeys.XAmzVersionIdHeader))
                    postResponse.VersionId = response.GetHeaderValue(HeaderKeys.XAmzVersionIdHeader);

                PostObjectRequest request = executionContext.RequestContext.OriginalRequest as PostObjectRequest;
                asyncResult.Request = request;
                asyncResult.Response = postResponse;
            }

            asyncResult.Exception = executionContext.ResponseContext.AsyncResult.Exception;
            asyncResult.Action = executionContext.RequestContext.Action;
            asyncResult.InvokeCallback();
        }
AmazonS3Client