protected virtual void ProcessResponse( MvxRestRequest restRequest, HttpWebRequest httpRequest, Action <MvxStreamRestResponse> successAction, Action <Exception> errorAction) { httpRequest.BeginGetResponse(result => TryCatch(() => { var response = (HttpWebResponse)httpRequest.EndGetResponse(result); var code = response.StatusCode; using (var responseStream = response.GetResponseStream()) { var restResponse = new MvxStreamRestResponse { CookieCollection = response.Cookies, Stream = responseStream, Tag = restRequest.Tag, StatusCode = code }; successAction(restResponse); } }, errorAction) , null); }
protected virtual void ProcessResponse( MvxRestRequest restRequest, HttpWebRequest httpRequest, Action<MvxStreamRestResponse> successAction, Action<Exception> errorAction) { httpRequest.BeginGetResponse(result => TryCatch(() => { var response = (HttpWebResponse) httpRequest.EndGetResponse(result); var code = response.StatusCode; using (var responseStream = response.GetResponseStream()) { var restResponse = new MvxStreamRestResponse { CookieCollection = response.Cookies, Stream = responseStream, Tag = restRequest.Tag, StatusCode = code }; successAction(restResponse); } }, errorAction) , null); }