예제 #1
0
        public static void PutFile(string url, HttpPara para, string file)
        {
            HttpWebRequest request = HttpWebUtility.Create(url, para, "PUT", null);

            HttpWebUtility.SentFile(request, file);
            HttpWebUtility.Receive(request);
        }
예제 #2
0
        public static void PutImage(string url, HttpPara para, Image image)
        {
            HttpWebRequest request = HttpWebUtility.Create(url, para, "PUT", null);

            HttpWebUtility.SentImage(request, image);
            HttpWebUtility.Receive(request);
        }
예제 #3
0
        public static void PutText(string url, HttpPara para, string text)
        {
            HttpWebRequest request = HttpWebUtility.Create(url, para, "PUT", null);

            HttpWebUtility.SentText(request, text);
            HttpWebUtility.Receive(request);
        }
예제 #4
0
        public static string Post(string url, HttpPara para, string text = null)
        {
            HttpWebRequest request = HttpWebUtility.Create(url, para, "POST", "application/x-www-form-urlencoded");

            if (text != null)
            {
                HttpWebUtility.SentText(request, text);
            }
            return(HttpWebUtility.ReceiveString(request));
        }
예제 #5
0
        public static CookieCollection GetCookie(string url, HttpPara para)
        {
            HttpWebRequest request = HttpWebUtility.Create(url, para, "HEAD", null);

            return(HttpWebUtility.ReceiveCookie(request));
        }
예제 #6
0
        public static string Operate(string url, HttpPara para, string method)
        {
            HttpWebRequest request = HttpWebUtility.Create(url, para, method, null);

            return(HttpWebUtility.ReceiveString(request));
        }
예제 #7
0
        public static void GetFile(string url, HttpPara para, string savePath)
        {
            HttpWebRequest request = HttpWebUtility.Create(url, para, "GET", null);

            HttpWebUtility.ReceiveFile(request, savePath);
        }
예제 #8
0
        public static string GetText(string url, HttpPara para)
        {
            HttpWebRequest request = HttpWebUtility.Create(url, para, "GET", null);

            return(HttpWebUtility.ReceiveString(request));
        }