protected virtual void ProcessRequestThen(MvxRestRequest restRequest, HttpWebRequest httpRequest, Action continueAction)
        {
            httpRequest.BeginGetRequestStream(result =>
            {
                using (var stream = httpRequest.EndGetRequestStream(result))
                {
                    restRequest.ProcessRequestStream(stream);
                    stream.Flush();
                }

                continueAction?.Invoke();
            }, null);
        }
        protected virtual void ProcessRequestThen(
            MvxRestRequest restRequest,
            HttpWebRequest httpRequest,
            Action continueAction,
            Action <Exception> errorAction)
        {
            httpRequest.BeginGetRequestStream(result =>
                                              TryCatch(() =>
            {
                using (var stream = httpRequest.EndGetRequestStream(result))
                {
                    restRequest.ProcessRequestStream(stream);
                    stream.Flush();
                }

                continueAction();
            }, errorAction)
                                              , null);
        }
示例#3
0
        protected virtual void ProcessRequestThen(
            MvxRestRequest restRequest,
            HttpWebRequest httpRequest,
            Action continueAction,
            Action<Exception> errorAction)
        {
            httpRequest.BeginGetRequestStream(result =>
                                              TryCatch(() =>
                                                  {
                                                      using (var stream = httpRequest.EndGetRequestStream(result))
                                                      {
                                                          restRequest.ProcessRequestStream(stream);
                                                          stream.Flush();
                                                      }

                                                      continueAction?.Invoke();
                                                  }, errorAction)
                                              , null);
        }