private void ProcessPostResponse(IAsyncResult result)
{
IAsyncExecutionContext executionContext = null;
IHttpRequest<string> httpRequest = null;
try
{
executionContext = result.AsyncState as IAsyncExecutionContext;
httpRequest = executionContext.RuntimeState as IHttpRequest<string>;
var httpResponse = httpRequest.EndGetResponse(result);
executionContext.ResponseContext.HttpResponse = httpResponse;
}
catch (Exception exception)
{
// Capture the exception and invoke outer handlers to
// process the exception.
executionContext.ResponseContext.AsyncResult.Exception = exception;
}
finally
{
httpRequest.Dispose();
}
PostResponseHelper(result);
}