Example #1
0
        public virtual void SetPostBody(string post)
        {
            if (UrlLoader == null)
            {
                UrlLoader = new URLLoader();
            }

            UrlLoader.SetPostBody(post);
        }
Example #2
0
        /// <summary>
        /// post方式提交数据
        /// </summary>
        /// <param name="url"></param>
        /// <param name="smodel"></param>
        /// <returns></returns>
        private string doPost(string url, object smodel)
        {
            string jsonstr = JsonConvert.SerializeObject(smodel);

            jsonstr = HttpUtility.UrlEncode(jsonstr, System.Text.Encoding.UTF8);

            URLLoader loader = new URLLoader();

            loader.SetPostBody(jsonstr);

            string response = loader.RequestByUTF8(url);

            return(response);
        }