예제 #1
0
 public Meta getMeta()
 {
     var RestConfig = new RestConfig();
     HttpWebRequest request = WebRequest.Create(RestConfig.meta) as HttpWebRequest;
     request.Method = "GET";
     HttpWebResponse response = request.GetResponse() as HttpWebResponse;
     Stream responseStream = response.GetResponseStream();
     string content = new StreamReader(responseStream).ReadToEnd();
     responseStream.Close();
     Meta meta = (Meta)JsonConvert.DeserializeObject(content, typeof(Meta));
     return meta;
 }
예제 #2
0
 public List<TopicView> getTopics()
 {
     var RestConfig = new RestConfig();
     HttpWebRequest request = WebRequest.Create(RestConfig.topics) as HttpWebRequest;
     request.Method = "GET";
     HttpWebResponse response = request.GetResponse() as HttpWebResponse;
     Stream responseStream = response.GetResponseStream();
     string content = new StreamReader(responseStream).ReadToEnd();
     responseStream.Close();
     List<TopicView> topics = (List<TopicView>)JsonConvert.DeserializeObject(content, typeof(List<TopicView>));
     return topics;
 }
예제 #3
0
 public TopicView getTopic(string name)
 {
     var RestConfig = new RestConfig();
     HttpWebRequest request = WebRequest.Create(RestConfig.topics + name) as HttpWebRequest;
     request.Method = "GET";
     HttpWebResponse response = request.GetResponse() as HttpWebResponse;
     Stream responseStream = response.GetResponseStream();
     string content = new StreamReader(responseStream).ReadToEnd();
     responseStream.Close();
     TopicView topic = (TopicView)JsonConvert.DeserializeObject(content, typeof(TopicView));
     return topic;
 }
예제 #4
0
        public Meta getMeta()
        {
            var            RestConfig = new RestConfig();
            HttpWebRequest request    = WebRequest.Create(RestConfig.meta) as HttpWebRequest;

            request.Method = "GET";
            HttpWebResponse response       = request.GetResponse() as HttpWebResponse;
            Stream          responseStream = response.GetResponseStream();
            string          content        = new StreamReader(responseStream).ReadToEnd();

            responseStream.Close();
            Meta meta = (Meta)JsonConvert.DeserializeObject(content, typeof(Meta));

            return(meta);
        }
예제 #5
0
        public TopicView getTopic(string name)
        {
            var            RestConfig = new RestConfig();
            HttpWebRequest request    = WebRequest.Create(RestConfig.topics + name) as HttpWebRequest;

            request.Method = "GET";
            HttpWebResponse response       = request.GetResponse() as HttpWebResponse;
            Stream          responseStream = response.GetResponseStream();
            string          content        = new StreamReader(responseStream).ReadToEnd();

            responseStream.Close();
            TopicView topic = (TopicView)JsonConvert.DeserializeObject(content, typeof(TopicView));

            return(topic);
        }
예제 #6
0
        public List <TopicView> getTopics()
        {
            var            RestConfig = new RestConfig();
            HttpWebRequest request    = WebRequest.Create(RestConfig.topics) as HttpWebRequest;

            request.Method = "GET";
            HttpWebResponse response       = request.GetResponse() as HttpWebResponse;
            Stream          responseStream = response.GetResponseStream();
            string          content        = new StreamReader(responseStream).ReadToEnd();

            responseStream.Close();
            List <TopicView> topics = (List <TopicView>)JsonConvert.DeserializeObject(content, typeof(List <TopicView>));

            return(topics);
        }