如题

解决方案 »

  1.   

    var xmlstring="";
    var submitForm = document.createElement("FORM");  
        document.body.appendChild(submitForm);  
        submitForm.method = "POST";  var newElement = document.createElement("input");  
        newElement.setAttribute("name","xml");  
        newElement.setAttribute("type","hidden");  
        newElement.setAttribute("value",xmlstring);  
        submitForm.appendChild(newElement); submitForm.submit();
      

  2.   

    在ASP.NET中实现POST发送数据

      

  3.   

    本帖最后由 net_lover 于 2010-12-24 14:52:35 编辑
      

  4.   

    方法2:String xml = "<data>中文</data>";;
    string strUrl = "http://www.k.com";      
    // 准备请求... 
    HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(strUrl); 
    myRequest.Method = "POST";       
    myRequest.ContentType="application/x-www-form-urlencoded";
    Stream newStream=myRequest.GetRequestStream();
    byte[] data = Encoding.GetEncoding("GB2312").GetBytes(xml);
    // 发送数据 
    newStream.Write(data,0,data.Length);
    HttpWebResponse res = myRequest.GetResponse() as HttpWebResponse;
    StreamReader sr  = new StreamReader(res.GetResponseStream(), Encoding.UTF8);
    String ret = sr.ReadToEnd();
    newStream.Close();
    Response.Write("你提交的是:" + Server.HtmlEncode( ret));