Example #1
0
        /// <summary>
        /// 向指定网址发送mulitpart编码的数据
        /// </summary>
        /// <param name="url">网址</param>
        /// <param name="mulitpartForm">mulitpart form data</param>
        /// <returns></returns>
        public string Post(string url, MultipartForm mulitpartForm)
        {
            HttpWebRequest request = CreateRequest(url, "POST");

            request.ContentType   = mulitpartForm.ContentType;
            request.ContentLength = mulitpartForm.FormData.Length;
            request.KeepAlive     = true;
            PostData(request, mulitpartForm.FormData);
            respHtml = encoding.GetString(GetData(request));
            return(respHtml);
        }
Example #2
0
 /// <summary>    
 /// 向指定网址发送mulitpart编码的数据    
 /// </summary>    
 /// <param name="url">网址</param>    
 /// <param name="mulitpartForm">mulitpart form data</param>    
 /// <returns></returns>    
 public string Post(string url, MultipartForm mulitpartForm)
 {
     HttpWebRequest request = CreateRequest(url, "POST");
     request.ContentType = mulitpartForm.ContentType;
     request.ContentLength = mulitpartForm.FormData.Length;
     request.KeepAlive = true;
     PostData(request, mulitpartForm.FormData);
     respHtml = encoding.GetString(GetData(request));
     return respHtml;
 }