Пример #1
0
        protected BisService.ResponseData <T> Get <T>(string url)
        {
            string html;

            using (var client = new BisWebClient())
            {
                client.AddHeader(Login);
                html = client.DownloadString(url);
            }

            return(Util.ConvertTo <BisService.ResponseData <T> >(html));
        }
Пример #2
0
        protected BisService.ResponseData <T> Delete <T>(string url, NameValueCollection postData, bool throwError = true)
        {
            byte[] responsebytes;
            using (var client = new BisWebClient())
            {
                client.AddHeader(Login);
                responsebytes = client.UploadValues(url, Constant.Method.DELETE, postData);
            }
            var res = Util.ConvertTo <BisService.ResponseData <T> >(responsebytes);

            if (throwError && !res.IsOkay())
            {
                throw new ServiceException(res.error);
            }
            return(res);
        }