idhttp post 网页出现http/1.0 500 错误,200分求解决。(200)

  • 主题发起人 主题发起人 wang_hn
  • 开始时间 开始时间
W

wang_hn

Unregistered / Unconfirmed
GUEST, unregistred user!
idhttp post 网页出现http/1.0 500 错误, 我已抓包,并且摹仿和抓 包后的内容一样发现但是不成功。还是500错误。但是我用网页去提交就没有问题。请大家帮下忙。我也是采用: Param := TIdMultipartFormDataStream.Create; Param.AddFormField('__EVENTTARGET', 'btn_Submit'); ............ IdHTTP.Post('http://www.*****/reg/index.aspx',param,rcv);这样的提交,如果验证码错误,还可以顺利提交,返回验证码错误的内容。。如果验证码是正确的。就会出现 http/1.0 500的错误。。。。。以下是抓包内容:POST /reg/index.aspx HTTP/1.1Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/x-silverlight, application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap, application/x-ms-application, application/msword, application/vnd.ms-powerpoint, application/vnd.ms-excel, */*Referer: http://******/reg/index.aspxAccept-Language: zh-cnContent-Type: multipart/form-data; boundary=---------------------------7da2de780a7eAccept-Encoding: gzip, deflateUser-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQDownload 618; TencentTraveler 4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; CIBA; InfoPath.2; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)Host: www.*****.com.cnContent-Length: 5918Connection: Keep-AliveCache-Control: no-cacheCookie: __utma=222580740.195550132.1271226114.1271226114.1271226114.1; __utmb=222580740; __utmc=222580740; __utmz=222580740.1271226114.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); ASP.NET_SessionId=o0o33zzgfkkimw55kfm1sw55-----------------------------7da2de780a7eContent-Disposition: form-data; name="__EVENTTARGET"btn_Submit-----------------------------7da2de780a7eContent-Disposition: form-data; name="__EVENTARGUMENT"-----------------------------7da2de780a7eContent-Disposition: form-data; name="__VIEWSTATE"/wEPDwUJMjA1NDY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yMAIyMQIyMgIyMwIyNAIyNQIyNgIyNwIyOAIyOQIzMAIzMRQrAx9nZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZGQYAQUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgMFHHJhZGlvX1VzZXJOYXR1cmVsbGFCcmFuZEZsYWcFFHJhZGlvX1VzZXJQR0luZm9GbGFnBQtyYWRpb19UZXJtc2u8A3HtpS4pTnMEDOmS0b1U+sIz-----------------------------7da2de780a7eContent-Disposition: form-data; name="__EVENTVALIDATION"/wEWHgKk082QBAL3xJvhBAL85dX3CgLQ5NbVDAK/0I2QDwKWtKQFAtHRig0ClYmKDQKcjKHjDAL76/apCQLo0IoRAr+N3QgCj+7pwQ4C16TklAUCy4DxqQIC4rfQpQ4C2K2lgQYCj7LinQoC+u601gECjJeCkQwC5oOTTALKiobsDALw+eKAAQKmmfu7BAKQ/p2iDwKu+KaXCQLn38yfCgLU2uCzBwKQvbbdDwLBt6SGDaF/FDv2lgrrixOogIYZcZ1l7whh-----------------------------7da2de780a7eContent-Disposition: form-data; name="txt_UserName"fddfbvcfxc-----------------------------7da2de780a7eContent-Disposition: form-data; name="txt_UserRealName"cxfcd-----------------------------7da2de780a7eContent-Disposition: form-data; name="inputFile"; filename=""Content-Type: application/octet-stream-----------------------------7da2de780a7eContent-Disposition: form-data; name="txt_UserPwd"fffffddd-----------------------------7da2de780a7eContent-Disposition: form-data; name="txt_UserConfirmPwd"fffffddd-----------------------------7da2de780a7eContent-Disposition: form-data; name="txt_UserEmail"fgbnfxgn@ddd.com-----------------------------7da2de780a7eContent-Disposition: form-data; name="radioList_Sex"濂?-----------------------------7da2de780a7eContent-Disposition: form-data; name="dorp_regyear"1990-----------------------------7da2de780a7eContent-Disposition: form-data; name="dorp_regmonth"03-----------------------------7da2de780a7eContent-Disposition: form-data; name="dorp_regdate"30-----------------------------7da2de780a7eContent-Disposition: form-data; name="txt_UserMobile"-----------------------------7da2de780a7eContent-Disposition: form-data; name="txt_UserQQ"-----------------------------7da2de780a7eContent-Disposition: form-data; name="txt_UserMsn"-----------------------------7da2de780a7eContent-Disposition: form-data; name="inputProvince"閲嶅簡-----------------------------7da2de780a7eContent-Disposition: form-data; name="inputCity"閲嶅簡-----------------------------7da2de780a7eContent-Disposition: form-data; name="txt_UserAddress"-----------------------------7da2de780a7eContent-Disposition: form-data; name="txt_UserPostCode"-----------------------------7da2de780a7eContent-Disposition: form-data; name="txt_UserImgCode"04j6x-----------------------------7da2de780a7eContent-Disposition: form-data; name="radio_UserNaturellaBrandFlag"radio-----------------------------7da2de780a7eContent-Disposition: form-data; name="radio_UserPGInfoFlag"radio-----------------------------7da2de780a7eContent-Disposition: form-data; name="radio_Terms"radio-----------------------------7da2de780a7eContent-Disposition: form-data; name="txtArea_UserInput"鑷?劧鏄?..-----------------------------7da2de780a7eContent-Disposition: form-data; name="hid_Province"閲嶅簡-----------------------------7da2de780a7eContent-Disposition: form-data; name="hid_City"閲嶅簡-----------------------------7da2de780a7eContent-Disposition: form-data; name="hid_Year"1990-----------------------------7da2de780a7eContent-Disposition: form-data; name="hid_Month"03-----------------------------7da2de780a7eContent-Disposition: form-data; name="hid_Day"30-----------------------------7da2de780a7e--
 
>>如果验证码错误,还可以顺利提交,返回验证码错误的内容。。如果验证码是正确的。就会出现 http/1.0 500的错误很清楚了,说明你提交的内容导致网站后台解析不了,而且出错了。为什么验证码错误的时候可以返回相关信息呢,一般网站都是先检测验证码是否正确,正确了才继续处理提交的内容,所以也容易理解。
 
这是我用idhttp post 的内容,应差不多啊。要说有区别应是这儿了。-----------------------------7da2de780a7eContent-Disposition: form-data; name="inputFile"; filename=""Content-Type: application/octet-stream提交文件,但网页上是提交空文件,如果我用.addfile(),是不能提交空文件 的。只能用Content-Disposition: form-data; name="inputFile" 代替了。,,如果去掉这句也一样是500错误,,,不知道问题 是不是出在这儿了。POST /reg/index.aspx HTTP/1.1Connection: Keep-AliveContent-Type: multipart/form-data; boundary=--------041510112357718Content-Length: 5376Cache-control: no-cacheCookie: ASP.NET_SessionId=uq0xo1yts5vwww24z1poedvpHost: www.*******.com.cnAccept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/x-silverlight, application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap, application/x-ms-application, application/msword, application/vnd.ms-powerpoint, application/vnd.ms-excel, */*Accept-Encoding: gzip, deflateidentityAccept-Language: zh-cnReferer: http://www.*******/reg/index.aspxUser-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQDownload 618; TencentTraveler 4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; CIBA; InfoPath.2; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)----------041510112357718Content-Disposition: form-data; name="__EVENTTARGET"btn_Submit----------041510112357718Content-Disposition: form-data; name="__EVENTARGUMENT"----------041510112357718Content-Disposition: form-data; name="__VIEWSTATE"/wEPDwUJMjA1NDY4MjEyD2QWAgIDD2QWBgIGDxBkEBVvBDE5MDAEMTkwMQQxOTAyBDE5MDMEMTkwNAQxOTA1BDE5MDYEMTkwNwQxOTA4BDE5MDkEMTkxMAQxOTExBDE5MTIEMTkxMwQxOTE0BDE5MTUEMTkxNgQxOTE3BDE5MTgEMTkxOQQxOTIwBDE5MjEEMTkyMgQxOTIzBDE5MjQEMTkyNQQxOTI2BDE5MjcEMTkyOAQxOTI5BDE5MzAEMTkzMQQxOTMyBDE5MzMEMTkzNAQxOTM1BDE5MzYEMTkzNwQxOTM4BDE5MzkEMTk0MAQxOTQxBDE5NDIEMTk0MwQxOTQ0BDE5NDUEMTk0NgQxOTQ3BDE5NDgEMTk0OQQxOTUwBDE5NTEEMTk1MgQxOTUzBDE5NTQEMTk1NQQxOTU2BDE5NTcEMTk1OAQxOTU5BDE5NjAEMTk2MQQxOTYyBDE5NjMEMTk2NAQxOTY1BDE5NjYEMTk2NwQxOTY4BDE5NjkEMTk3MAQxOT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dDwLBt6SGDaF/FDv2lgrrixOogIYZcZ1l7whh----------041510112357718Content-Disposition: form-data; name="txt_UserName"lebanonvzyqajosae----------041510112357718Content-Disposition: form-data; name="txt_UserRealName"----------041510112357718Content-Disposition: form-data; name="inputFile"----------041510112357718Content-Disposition: form-data; name="txt_UserPwd"rrkucfbthtecpwd----------041510112357718Content-Disposition: form-data; name="txt_UserConfirmPwd"rrkucfbthtecpwd----------041510112357718Content-Disposition: form-data; name="txt_UserEmail"california962919@sina.com----------041510112357718Content-Disposition: form-data; name="radioList_Sex"濂?----------041510112357718Content-Disposition: form-data; name="dorp_regyear"1984----------041510112357718Content-Disposition: form-data; name="dorp_regmonth"4----------041510112357718Content-Disposition: form-data; name="dorp_regdate"16----------041510112357718Content-Disposition: form-data; name="txt_UserMobile"----------041510112357718Content-Disposition: form-data; name="txt_UserQQ"----------041510112357718Content-Disposition: form-data; name="txt_UserMsn"----------041510112357718Content-Disposition: form-data; name="inputProvince"璐靛窞----------041510112357718Content-Disposition: form-data; name="inputCity"閬典箟----------041510112357718Content-Disposition: form-data; name="txt_UserAddress"----------041510112357718Content-Disposition: form-data; name="txt_UserPostCode"----------041510112357718Content-Disposition: form-data; name="txt_UserImgCode"NRRT4----------041510112357718Content-Disposition: form-data; name="radio_UserNaturellaBrandFlag"radio----------041510112357718Content-Disposition: form-data; name="radio_UserPGInfoFlag"radio----------041510112357718Content-Disposition: form-data; name="radio_Terms"radio----------041510112357718Content-Disposition: form-data; name="txtArea_UserInput"鑷?劧鏄?..----------041510112357718Content-Disposition: form-data; name="hid_Province"璐靛窞----------041510112357718Content-Disposition: form-data; name="hid_City"閬典箟----------041510112357718Content-Disposition: form-data; name="hid_Year"1984----------041510112357718Content-Disposition: form-data; name="hid_Month"4----------041510112357718Content-Disposition: form-data; name="hid_Day"16----------041510112357718--
 
总算找到问题了。网页提交是这样的-----------------------------7da2de780a7eContent-Disposition: form-data; name="inputFile"; filename=""Content-Type: application/octet-stream提交文件,但网页上是提交空文件,如果我用.addfile(),是不能提交空文件 的。只能用Content-Disposition: form-data; name="inputFile" 代替了。,,如果去掉这句也一样是500错误,,,还真是这个问题,后来用别的方法代替上了,还是变成这样才行Content-Disposition: form-data; name="inputFile"; filename=""Content-Type: application/octet-stream
 
后退
顶部