再搞不定要死人了 关于用inet控件post提交回帖
猫扑贴贴的帖子
用抓包工具抓包后 写vb代码 post回帖数据
无论怎么搞 都提示上传图片太大 实际上我没有上传图片 只是回复文字
抓包数据如下
POST /subject/reply.do HTTP/1.1
Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, */*
Referer: http://tt.mop.com/read_11683285_0_0.html
Accept-Language: zh-cn
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)
Content-Type: multipart/form-data; boundary=---------------------------7dc2bf353430622
Accept-Encoding: gzip, deflate
Host: tt.mop.com
Content-Length: 496
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: mopst_unique=13528168099683026; mop_locale=0086370800; message_time=1352818957770 -----------------------------7dc2bf353430622
Content-Disposition: form-data; name="sid" 11683285
-----------------------------7dc2bf353430622
Content-Disposition: form-data; name="replyBody" ddddddddddd
-----------------------------7dc2bf353430622
Content-Disposition: form-data; name="nologin_username" xflhniee
-----------------------------7dc2bf353430622
Content-Disposition: form-data; name="nologin_password" f6j6hf3fap510
-----------------------------7dc2bf353430622--
无论怎么搞 都提示上传图片太大 实际上我没有上传图片 只是回复文字
老师们快帮帮我吧 折磨啊
我的代码
myurl = "http://tt.mop.com/subject/reply.do"
send_data = "sid=11683285&replyBody=ddddddddddd&nologin_username=xflhniee&nologin_password=f6j6hf3fap510"
my_head = "Content-Type: application/x-www-form-urlencoded" & vbCrLf
my_head = my_head & "Cache-Control: no-cache" & vbCrLf
my_head = my_head & "Connection: Keep-Alive" & vbCrLf
my_head = my_head & "Referer: http://tt.mop.com/read_11683285_0_0.html" & vbCrLf
Inet1.Execute myurl, "POST", send_data, my_head
[最优解释]
路见不平,拔刀相助
Dim strurl As String
Dim strhead As String
Dim strdata As String
strurl = "http://tt.mop.com/subject/reply.do"
strhead = "Accept: */*" & vbCrLf
strhead = strhead & "Referer: " & CStr(txtUrl.Text) & vbCrLf '顶贴页面地址
strhead = strhead & "Content-Type: multipart/form-data; boundary=---------------------------7db3a9217108b6" & vbCrLf
strdata = ""
'不登陆直接回帖
strdata = strdata & "-----------------------------7db3a9217108b6" & vbCrLf
strdata = strdata & "Content-Disposition: form-data; name=""sid""" & vbCrLf
strdata = strdata & vbCrLf
strdata = strdata & CStr(txtId.Text) & vbCrLf '回帖ID
strdata = strdata & "-----------------------------7db3a9217108b6" & vbCrLf
strdata = strdata & "Content-Disposition: form-data; name=""nologin_username""" & vbCrLf
strdata = strdata & vbCrLf
strdata = strdata & CStr(TxtUser.Text) & vbCrLf '用户名
strdata = strdata & "-----------------------------7db3a9217108b6" & vbCrLf
strdata = strdata & "Content-Disposition: form-data; name=""nologin_password""" & vbCrLf
strdata = strdata & vbCrLf
strdata = strdata & CStr(TxtPassWord.Text) & vbCrLf '密码
strdata = strdata & "-----------------------------7db3a9217108b6" & vbCrLf
strdata = strdata & "Content-Disposition: form-data; name=""replyBody""" & vbCrLf
strdata = strdata & vbCrLf
strdata = strdata & CStr("顶贴内容") & vbCrLf '回复的内容
strdata = strdata & "-----------------------------7db3a9217108b6--" & vbCrLf
strdata = strdata & vbCrLf
[其他解释]
楼主,我用JAVA写了一个也是报图片过大,你试过用抓包工具查看过如果带图片上传时带有什么参数吗?估计是服务端做的判断,比如未带图片参数时就会报这个错。
[其他解释]
等大侠出现救我
[其他解释]
肯定是你写错喽!!
[其他解释]
内事不决,上百度
外事不决,上谷歌
按这个方针去,一定能成功
[其他解释]
my_head = my_head & "Host: tt.mop.com" & vbCrLf
my_head = my_head & "Content-Length: " & Len(send_data) & vbCrLf
my_head = my_head & "Connection: Keep-Alive" & vbCrLf
my_head = my_head & "Cache-Control: no-cache" & vbCrLf & vbCrLf
If Inet1.StillExecuting = True Then Inet1.Cancel
Inet1.Execute myurl, "POST", send_data, my_head
[其他解释]
如果带上 my_head = my_head & "Accept-Encoding: gzip, deflate" & vbCrLf
就不提示图片过大了 什么都不返回了 回帖也不成功
[其他解释]