Пример #1
0
        public async Task <AboutLRSResponse> About()
        {
            var r = new AboutLRSResponse();

            var req = new MyHTTPRequest();

            req.method   = HttpMethod.Get;
            req.resource = "about";

            var res = await MakeRequest(req);

            if (res.status != HttpStatusCode.OK)
            {
                r.success       = false;
                r.httpException = res.ex;
                r.SetErrMsgFromBytes(res.content, (int)res.status);
                return(r);
            }

            r.success = true;
            r.content = new About(Encoding.UTF8.GetString(res.content, 0, res.content.Length));

            return(r);
        }
Пример #2
0
        public AboutLRSResponse About()
        {
            var r = new AboutLRSResponse();

            var req = new MyHTTPRequest();

            req.method   = "GET";
            req.resource = "about";

            var res = MakeSyncRequest(req);

            if (res.status != HttpStatusCode.OK)
            {
                r.success       = false;
                r.httpException = res.ex;
                r.SetErrMsgFromBytes(res.content);
                return(r);
            }

            r.success = true;
            r.content = new About(Encoding.UTF8.GetString(res.content));

            return(r);
        }