HttpWebRequest Post方式传值
来源:互联网 发布:ubuntu怎么安装输入法 编辑:程序博客网 时间:2024/05/23 17:15
HttpWebRequest Post方式传值
{
// string param = "UID=" + strUid + "&FunctionName=Survey";
//string param = "UID=2fba7bf3-64fc-478b-8e71-178af0dcc548&FunctionName=Survey";
byte[] bs = Encoding.ASCII.GetBytes(param);
//string strUrl = @"http://202.142.26.39/GetFunctionList.aspx";
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(strUrl);
req.Method = "POST";
//req.Timeout = 10;
req.ContentType = "application/x-www-form-urlencoded";
req.ContentLength = bs.Length;
using (Stream reqStream = req.GetRequestStream())
{
reqStream.Write(bs, 0, bs.Length);
}
HttpWebResponse rep = (HttpWebResponse)req.GetResponse();
Stream receiveStream = rep.GetResponseStream();
Encoding encode = System.Text.Encoding.GetEncoding("UTF-8");
StreamReader readStream = new StreamReader(receiveStream, encode);
Char[] read = new Char[256];
int count = readStream.Read(read, 0, 256);
StringBuilder sb = new StringBuilder("");
while (count > 0)
{
String readstr = new String(read, 0, count);
sb.Append(readstr);
count = readStream.Read(read, 0, 256);
}
rep.Close();
readStream.Close();
return sb.ToString();
// XmlDocument doc = new XmlDocument();
// string xml = sb.ToString();
// doc.LoadXml(xml);
- HttpWebRequest Post方式传值
- HttpWebRequest Post 方式发送 XML数据
- (HttpWebRequest )服务器上传请求Post方式
- Http请求之--C#的HttpWebRequest实现POST方式请求
- HttpWebRequest发送Post数据
- HttpWebRequest发送数据 post
- HttpWebRequest GET POST 应用
- C# 使用HttpWebRequest Post
- HttpWebRequest Post数据
- .net HttpWebRequest Post xml
- form post 方式传值
- JS POST 传值方式
- 使用HttpWebRequest发送HTTP请求,同时支持GET/POST方式提交。
- 使用HttpWebRequest发送自定义POST请求(以http方式推送消息)
- silverlight HttpWebRequest post请求数据
- HttpWebRequest发送模拟POST请求
- C# HttpWebRequest提交post请求
- 关于HttpWebRequest Post数据学习
- 五要,五一
- 选取XML节点值的效率改进
- Cisco 2611路由器,也可以用CallManager Express!
- MFC右下角动画弹出窗口类 MFC托盘程序类(转)
- 库文件
- HttpWebRequest Post方式传值
- vc++写注册表自启动( 转)
- 业务流程分析
- 如何开启PHP curl函数库
- lr录制脚本提示不能连接服务器。
- ASP.NET读取EXCEL文件的三种经典方法
- 软件测试常用单词
- Eclipse中classpath和link配制总结
- 从源代码中打造一个最小的Linux操作系统