Exemplo n.º 1
0
        /// <summary>
        /// 使用get来调用Web
        /// </summary>
        /// <returns></returns>
        public string GetData()
        {
            FormPost   post = GetFormPost();
            APIResault ret  = null;


            string rurl = GetFullGetUrl();
            string res  = post.GetData(rurl);



            return(res);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 使用get来调用Web
        /// </summary>
        /// <returns></returns>
        public APIResault DoGet()
        {
            FormPost   post = GetFormPost();
            APIResault ret  = null;

            try
            {
                string rurl = GetFullGetUrl();
                string res  = post.GetData(rurl);
                ret = new APIResault();
                ret.SetJson(res);
            }
            catch (WebException ex)
            {
                ret = GetExAPI(ex);
            }
            catch (Exception ex)
            {
                ret = new APIResault();
                ret.SetException(ex);
            }
            return(ret);
        }