Ejemplo n.º 1
0
        public static string Get(string url, NameValueCollection headers)
        {
            HttpCommand webCommand = new HttpCommand(url, "Get");

            webCommand.Headers = headers;
            return(webCommand.Execute());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Put方法
        /// </summary>
        /// <param name="strUrl">链接地址</param>
        /// <param name="strData">数据</param>
        /// <returns></returns>
        public static string Put(string strUrl, string strData)
        {
            HttpCommand Webcommand = new HttpCommand(strUrl, "Put");

            if (!string.IsNullOrEmpty(strData))
            {
                Webcommand.ContentType = "application/x-www-form-urlencoded";
                Webcommand.Data        = strData;
            }
            return(Webcommand.Execute());
        }
Ejemplo n.º 3
0
        public static string Post(string url, string data, NameValueCollection headers)
        {
            HttpCommand webCommand = new HttpCommand(url, "Post");

            webCommand.Headers = headers;
            if (!string.IsNullOrEmpty(data))
            {
                webCommand.ContentType = "application/json";
                webCommand.Data        = data;
            }
            return(webCommand.Execute());
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Delete方法
        /// </summary>
        /// <param name="strUrl">链接地址</param>
        /// <returns></returns>
        public static string Delete(string strUrl)
        {
            HttpCommand Webcommand = new HttpCommand(strUrl, "DELETE");

            return(Webcommand.Execute());
        }
Ejemplo n.º 5
0
        /// <summary>
        /// get方法
        /// </summary>
        /// <param name="strUrl">链接地址</param>
        /// <returns></returns>
        public static string Get(string strUrl)
        {
            HttpCommand Webcommand = new HttpCommand(strUrl, "Get");

            return(Webcommand.Execute());
        }