Ejemplo n.º 1
0
        /// <summary>
        /// 设定编码的
        /// </summary>
        /// <param name="url"></param>
        /// <param name="encoding"></param>
        /// <returns></returns>
        public static string Get(string url, Encoding encoding)
        {
            var sync = new SyncHttp {
                CurrEncoding = encoding
            };

            return(sync.HttpGet(url));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Post方法请求并返回消息 ,可配超时
 /// </summary>
 /// <param name="url">包含查询字符串的Url地址</param>
 /// <param name="urlParameters">参数集合</param>
 /// <param name="timeout">超时,豪秒</param>
 /// <returns></returns>
 public static string Post(string url, HttpParams urlParameters, int timeout)
 {
     var sync = new SyncHttp(timeout);
     return sync.HttpPost(url, urlParameters);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Get方法请求并返回消息 ,超时可配
 /// </summary>
 /// <param name="url">包含查询字符串的Url地址</param>
 /// <param name="timeout">超时,豪秒</param>
 /// <returns></returns>
 public static string Get(string url, int timeout)
 {
     var sync = new SyncHttp(timeout);
     return sync.HttpGet(url);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 设定编码的
 /// </summary>
 /// <param name="url"></param>
 /// <param name="encoding"></param>
 /// <returns></returns>
 public static string Get(string url,Encoding encoding)
 {
     var sync = new SyncHttp {CurrEncoding = encoding};
     return sync.HttpGet(url);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Get方法请求并返回消息,默认超时 
 /// </summary>
 /// <param name="url">包含查询字符串的Url地址</param>
 /// <returns></returns>
 public static string Get(string url)
 {
     var sync = new SyncHttp();
     return sync.HttpGet(url);
 }
Ejemplo n.º 6
0
 /// <summary>
 ///  Post方法请求并返回消息 ,可配超时
 /// </summary>
 /// <param name="url"></param>
 /// <param name="data"></param>
 /// <param name="timeout"></param>
 /// <returns></returns>
 public static string Post(string url, string data, int timeout)
 {
     var sync = new SyncHttp(timeout);
     return sync.HttpPost(url, data);
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Post方法请求并返回消息 ,可配超时
        /// </summary>
        /// <param name="url">包含查询字符串的Url地址</param>
        /// <param name="urlParameters">参数集合</param>
        /// <param name="timeout">超时,豪秒</param>
        /// <returns></returns>
        public static string Post(string url, HttpParams urlParameters, int timeout)
        {
            var sync = new SyncHttp(timeout);

            return(sync.HttpPost(url, urlParameters));
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Get方法请求并返回消息 ,超时可配
        /// </summary>
        /// <param name="url">包含查询字符串的Url地址</param>
        /// <param name="timeout">超时,豪秒</param>
        /// <returns></returns>
        public static string Get(string url, int timeout)
        {
            var sync = new SyncHttp(timeout);

            return(sync.HttpGet(url));
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Get方法请求并返回消息,默认超时
        /// </summary>
        /// <param name="url">包含查询字符串的Url地址</param>
        /// <returns></returns>
        public static string Get(string url)
        {
            var sync = new SyncHttp();

            return(sync.HttpGet(url));
        }