Response object returned after HTTP browser post For more information,
Inheritance: Amazon.Runtime.AmazonWebServiceResponse
コード例 #1
0
        private void PostResponseHelper(IAsyncResult result)
        {
            IAsyncExecutionContext executionContext = result.AsyncState as IAsyncExecutionContext;
            IWebResponseData response = executionContext.ResponseContext.HttpResponse;
            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);

            PostObjectRequest request = executionContext.RequestContext.OriginalRequest as PostObjectRequest;

            RuntimeAsyncResult asyncResult = executionContext.ResponseContext.AsyncResult as RuntimeAsyncResult;
            asyncResult.Request = request;
            asyncResult.Response = postResponse;
            asyncResult.Exception = executionContext.ResponseContext.AsyncResult.Exception;
            asyncResult.Action = executionContext.RequestContext.Action;
            asyncResult.InvokeCallback();
        }
コード例 #2
0
        private void PostResponseHelper(IAsyncResult result)
        {
            IAsyncExecutionContext executionContext = result.AsyncState as IAsyncExecutionContext;
            IWebResponseData response = executionContext.ResponseContext.HttpResponse;
            PostObjectResponse postResponse = new PostObjectResponse(response);
            PostObjectRequest request = executionContext.RequestContext.OriginalRequest as PostObjectRequest;

            RuntimeAsyncResult asyncResult = executionContext.ResponseContext.AsyncResult as RuntimeAsyncResult;
            asyncResult.Request = request;
            asyncResult.Response = postResponse;
            asyncResult.Exception = executionContext.ResponseContext.AsyncResult.Exception;
            asyncResult.Action = executionContext.RequestContext.Action;
            asyncResult.InvokeCallback();
        }