怎么把xml格式的字符串post到www.k.com?? 如题 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 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(); 在ASP.NET中实现POST发送数据 本帖最后由 net_lover 于 2010-12-24 14:52:35 编辑 方法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)); Repeater嵌套的问题谁能帮我啊谢谢啦 关于代码隐藏的问题 如何实现DIV的半透明边框? 表格行里面用getElementById为什么不行的。 !!!!!!!!!!!!!!我喜欢公司老板的女儿了(续6)!!!!!!!!!!! 求一段分页代码~ 要求不用asp.net 控件 请问网站测试好用,挂到空间就不能用,高手指点。 客户端和服务端的磁盘文件之间如何通讯的问题??? ASP.net和SQL的问题¥¥¥¥¥大分求解! 求关于多文件上传的后台代码,希望各位大侠帮忙 生成的PDF里有条形码 vs2005水晶报表提前换行
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();
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));