本帖最后由 其实我很美 于 2013-12-16 15:55 编辑
[C#] 纯文本查看 复制代码 item = new HttpItem()
{
URL = "http://tieba.baidu.com/pmc/tpl",
Method="pots",
Postdata= post,
Cookie=cookie,
Referer="http://tieba.baidu.com/f?ie=utf-8&kw=%E6%AD%A6%E6%B1%89",
ProtocolVersion = HttpVersion.Version10,//
ContentType = "application/x-www-form-urlencoded; charset=UTF-8",
UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; WOW64; Trident/6.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729)",
Accept = "application/json, text/javascript, */*; q=0.01",
};
item.Header.Add("x-requested-with", "XMLHttpRequest");
这个上面是我代码。下面是抓的包,一直提示连接意外关闭,
[HTML] 纯文本查看 复制代码 POST /pmc/tpl HTTP/1.1
Accept: application/json, text/javascript, */*; q=0.01
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Referer: http://tieba.baidu.com/f?ie=utf-8&kw=%E6%AD%A6%E6%B1%89
Accept-Language: zh-cn
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; WOW64; Trident/6.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729)
Host: tieba.baidu.com
Content-Length: 41
DNT: 1
Connection: Keep-Alive
Cache-Control: no-cache
Cookie:
fid=4107&tbs=a5a04767e0a57ee91387174879
|