用HttpWebRequest做POST请求时返回Http 417 错误解决方法
2011-08-18 12:16
801 查看
原因是HttpWebRequest在默认情况下发出请求会添加“Expect: 100-Continue”请求头。
解决方案:
HttpWebRequest httpWebRequest= httpWebRequest = (HttpWebRequest)HttpWebRequest.Create(url);
httpWebRequest.ServicePoint.Expect100Continue = false;//指定此属性为false
解决方案:
HttpWebRequest httpWebRequest= httpWebRequest = (HttpWebRequest)HttpWebRequest.Create(url);
httpWebRequest.ServicePoint.Expect100Continue = false;//指定此属性为false
相关文章推荐
- 用HttpWebRequest做POST请求时返回Http 417 错误解决方法
- wp7使用POST请求Asp.net网页时,HttpWebRequest的BeginGetResponse方法抛出NotSupportException异常的解决方法
- 通过httpwebrequest实现http的post和get方法莫名出现500内部服务器错误的解决办法
- 发送POST请求出现Http 417错误的解决方法
- C#利用HttpWebRequest后台请求,出现:基础连接已经关闭: 接收时发生错误;【解决方法之一】
- 用HttpWebRequest做POST请求时返回Http 417 expectation failed
- C# post数据时 出现如下错误: System.Net.WebException: 远程服务器返回错误: (417) Expectation Failed 的解决办法
- https使用HttpWebRequest出现错误:System.IO.IOException: Received an unexpected EOF or 0 bytes from the transport stream.的解决方法
- WebRequest 请求被中止: 请求已被取消。 错误解决方法
- HttpWebRequest请求返回非200的时候 HttpWebResponse怎么接受返回错误提示
- C#POST数据,HttpWebRequest请求页面,HttpWebResponse返回数据
- C# post数据时 出现如下错误: System.Net.WebException: 远程服务器返回错误: (417) Expectation Failed 的解决办法
- 在使用 HttpWebRequest Post数据时候返回 400错误
- Nginx直接post请求获取静态文件 返回405错误的终极解决方法
- C# 模拟post数据提交时 出现如下错误: System.Net.WebException: 远程服务器返回错误: (417) Expectation Failed 的解决办法
- Apache、IIS、Nginx等绝大多数web服务器,都不允许静态文件响应POST请求,否则会返回“HTTP/1.1 405 Method not allowed”错误。
- 【转】System.Net.HttpWebRequest请求超时的问题解决方法
- 用httpWebRequest调用https开头的php webservice,报“基础连接已经关闭: 未能为SSL/TLS 安全通道建立信任关系”错误的解决方法
- dotnet 使用HttpWebRequest向Https Post数据时,需要证书确认的解决方法
- [转]C# post数据时 出现如下错误: System.Net.WebException: 远程服务器返回错误: (417) Expectation Failed 的解决办法