当前位置:编程学习 > C#/ASP.NET >>

求助大神关于httpwebresponse的POST格式

看了下关于POST的代码,也对POST的包进行了抓取,但是感觉POST的东西很多,试了下,提交失败了,网页没有任何变化,实在是不知道哪些该写进代码,哪些不需要,求大神帮忙看看这个POST的包哪些需要写到代码里,谢谢各位大神了

POST
/forum.php?mod=post&action=reply&fid=830&tid=28827301&extra=&replysubmit=yes&infloat=yes&handlekey=fastpost&inajax=1
HTTP/1.1
Accept: text/html, application/xhtml+xml,*/*
DNT: 1
Referer:http://bbs.duowan.com/forum.php?mod=viewthread&tid=28827301&page=6
Accept-Language: zh-CN
User-Agent: Mozilla/5.0 (compatible; MSIE9.0; Windows NT 6.1; WOW64; Trident/5.0)
Content-Type:application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
Host: bbs.duowan.com
Content-Length: 59
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: bbs_4477_sid=M1hwrW;
bbs_4477_saltkey=1mpZc0Gt; bbs_4477_lastvisit=1351433237;
bbs_4477_lastact=1352031022%09forum.php%09viewthread; bbs_4477_forum_lastvisit=D_830_1352030887;
bbs_4477_visitedfid=830; bbs_4477_cookietime=1;
bbs_4477_auth=3ef7t9KNHlw%2FlGabIXi8MPMY1w5V9EnFvg6jP%2B%2Braqfkg2jvHw;
bbs_4477_ulastactivity=f0afkWeLyCDn8PKlB9iw%2FP3PfnFF%2FgqqZ%2BVmQ5a%2FJBkQccZl5eF8;
bbs_4477_smile=1D1; bbs_4477_forum_lastpage=830_1; bbs_4477_sendmail=1;
bbs_4477_noticeTitle=1; hiido_ui=0.7695972212533371;
bbs_4477_fid830=1351953302;
Hm_lvt_0475e9919a7ba48887772bb84a8dd9e9=1325583818951;
Hm_lvt_899fe607527b6d40d67e743dc3f660e0=1351913248569,1351932413330,1351950688149,1352030891869;
Hm_lpvt_899fe607527b6d40d67e743dc3f660e0=1352031022847
 
message=test&posttime=1352031022&formhash=ca66c950&subject= --------------------编程问答-------------------- 重要的东西就是post的url地址,参数,cookie
其他设置都不太关系。
不成功很可能是cookie不对,这是在duowan回帖么?要先登陆,记得带好cookie。 --------------------编程问答-------------------- post内容。。refer,cookie,User-Agent...主意这些就行了~ --------------------编程问答-------------------- 利用HttpWebRequest获取post地址并用CookieContainer来存放Cookie集合
然后再进行操作。取得cookies才能进行下一步操作。
参考
http://www.cnblogs.com/kenter/archive/2009/11/10/1599604.html
http://bbs.csdn.net/topics/370070280
--------------------编程问答-------------------- 楼主抓的是登陆过程的数据包吗?没有看到用户名和密码啊。要抓登陆过程的数据包才能确定要post的数据
--------------------编程问答--------------------
引用 1 楼 haukwong 的回复:
重要的东西就是post的url地址,参数,cookie
其他设置都不太关系。
不成功很可能是cookie不对,这是在duowan回帖么?要先登陆,记得带好cookie。


意思是如果要POST,一定要首先获得登录时获得的COOKIE么,可不可以用这个回帖时抓包所用的COOKIE呢?还是说一定要抓登陆时POST的包呢,谢谢了 --------------------编程问答--------------------
引用 5 楼 priesthgink 的回复:
引用 1 楼 haukwong 的回复:重要的东西就是post的url地址,参数,cookie
其他设置都不太关系。
不成功很可能是cookie不对,这是在duowan回帖么?要先登陆,记得带好cookie。

意思是如果要POST,一定要首先获得登录时获得的COOKIE么,可不可以用这个回帖时抓包所用的COOKIE呢?还是说一定要抓登陆时POST的包呢,谢谢了
……

是这个意思,cookie要一直保留。不可单独抓回帖的cookie
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,