日期:2014-05-17  浏览次数:20678 次

HttpWebRequest求教
折腾了一下午了,老是不成功。

我用winform请求一个网站,服务器是Php的,用firebug追踪到的请求信息是

Accept text/html, */*
Accept-Encoding gzip, deflate
Accept-Language zh-cn,zh;q=0.5
Cache-Control no-cache
Connection keep-alive
Content-Length 29
Content-Type application/x-www-form-urlencoded; charset=UTF-8
Cookie s_cc=true; s_sq=%5B%5BB%5D%5D; __atuvc=6%7C36
Host www.***.com.hk
Pragma no-cache
Referer http://www.***.com.hk/calendar/index.html
User-Agent Mozilla/5.0 (Windows NT 6.1; rv:10.0) Gecko/20100101 Firefox/10.0
X-Requested-With XMLHttpRequest

post信息是

参数application/x-www-form-urlencoded
date 2012-09-01
type calendar
源代码
type=calendar&date=2012-09-01

但是我每次执行都会报:
远程服务器返回错误: (417) Expectation failed。

他的源码里面是这个:
onSelect: function () {
var params = {};
params["type"] = "calendar";
params["date"] = $(this).val();
$('#calTable').load("/inc/process.php", params, function(data){
$(this).html(gbBig5(data));
}); 

怀疑是ajax请求的关系,但是用了网上说的那种XMLHTTPRequest方式,
服务端返回的结果依然是错的,没有请求到数据

请高手帮忙~!

------解决方案--------------------
还在加qq 116205979 我来看看