以POST方式访问wcf方法
来源:互联网 发布:iphoto下载 mac 编辑:程序博客网 时间:2024/05/17 22:02
public string Post(string url, string UpSaleInfo)
{
try
{
HttpWebRequest requestPost = WebRequest.Create(url) as HttpWebRequest;
requestPost.CookieContainer = new CookieContainer();
requestPost.Method = "POST";
requestPost.ContentType = "application/x-www-form-urlencoded";
byte[] postData = Encoding.ASCII.GetBytes(UpSaleInfo);
requestPost.ContentLength = postData.LongLength;
requestPost.KeepAlive = true;
Stream postStream = requestPost.GetRequestStream();
postStream.Write(postData, 0, postData.Length);
postStream.Close();
HttpWebResponse response = (HttpWebResponse)requestPost.GetResponse();
Stream myResponseStream = response.GetResponseStream();
StreamReader myStreamReader = new StreamReader(myResponseStream, Encoding.GetEncoding("utf-8"));
string retString = myStreamReader.ReadToEnd();
myStreamReader.Close();
myResponseStream.Close();
return retString;
}
catch (Exception ex)
{
throw ex;
}
}
- 以POST方式访问wcf方法
- 以Get方式访问wcf方法
- 客户端以post方式调用Wcf
- 客户端以post方式调用Wcf 2
- 通过jQuery以HTTP GET/POST方式调用WCF服务
- Android通过GET和POST方式访问WCF服务(Json)
- 使用post()方法以POST方式从服务器发送数据
- WebService 通过POST方式访问时候,因 URL 意外地以“/方法名”结束,请求格式无法识别 解决办法
- python以post方式登录csdn网站,并以cookie方式访问个人信息
- 以Post方式请求
- Post方式调用wcf服务
- Post方式调用wcf服务
- Window.location.href以post方式传递参数的方法
- Window.location.href以post方式传递参数的方法
- WCF 的 Web 访问方式
- 以POST方式下载文件
- 【jQuery】使用post()方法以POST方式从服务器发送数据
- WCF中REST使用POST方式
- C
- 交换类排序:冒泡排序和快速排序
- 配置host文件
- 模拟实现strstr、strrstr
- spring+cxf发布服务报错Error creating bean with name 'org.apache.cxf.jaxws.spring.NamespaceHandler$SpringSe
- 以POST方式访问wcf方法
- IntelliJ IDEA 配置Gradle运行SpringBoot Web项目(tomcat容器)
- Android程序员学WEB前端(2)-HTML(2)-锚点链接列表表单-Sublime
- PHP isset()与empty()的使用区别详解
- node连接数据库mysql
- ubuntu c++ 连接mysql
- MyEclipse、Tomcat、Maven、SVN环境搭建
- Java技术----Java泛型详解
- Android中JniHelper类里 getStaticMethodInfo的使用