Ejemplo n.º 1
0
        protected virtual void ProcessResponse(
            MvxRestRequest restRequest,
            HttpWebRequest httpRequest,
            Action <MvxRestResponse> successAction,
            Action <Exception> errorAction)
        {
            httpRequest.BeginGetResponse(result =>
                                         TryCatch(() =>
            {
                var response = (HttpWebResponse)httpRequest.EndGetResponse(result);

                var code = response.StatusCode;

                var restResponse = new MvxRestResponse
                {
                    CookieCollection = response.Cookies,
                    Tag        = restRequest.Tag,
                    StatusCode = code
                };
                successAction(restResponse);
            }, errorAction)
                                         , null);
        }
Ejemplo n.º 2
0
        protected virtual void ProcessResponse(
            MvxRestRequest restRequest,
            HttpWebRequest httpRequest,
            Action<MvxRestResponse> successAction,
            Action<Exception> errorAction)
        {
            httpRequest.BeginGetResponse(result =>
                                         TryCatch(() =>
                                             {
                                                 var response = (HttpWebResponse) httpRequest.EndGetResponse(result);

                                                 var code = response.StatusCode;

                                                 var restResponse = new MvxRestResponse
                                                     {
                                                         CookieCollection = response.Cookies,
                                                         Tag = restRequest.Tag,
                                                         StatusCode = code
                                                     };
                                                 successAction(restResponse);
                                             }, errorAction)
                                         , null);
        }