我使用了firefox的Tamper插件,我有4个POST输入:
login=myloginpassword=mypasswordbutton_Dologin.x=33button_Dologin.y=6
我试着再次使用curl
curl.exe --data 'login=mylogin&password=mypassword&button_Dologin.x=33&button_Dologin.y=6' www.centralgreen.com.sg/login.PHP?ccsForm=Login
但是登录显然没有通过(此命令的输出是相同的形式,只填充了密码,并且出现错误消息“用户名”字段中的值是必需的.)
以下是我从Tamper获得的完整信息列表
Host centralgreen.com.sgUser-Agent Mozilla/5.0 (windows NT 5.1; rv:2.0) Gecko/20100101 firefox/4.0Accept text/HTML,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8Accept Language en-us,en;q=0.5Accept EnCoding gzip,deflateAccept Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7Keep Alive 115Connection keep-aliveReferer http://centralgreen.com.sg/login.PHPcookie PHPSESSID=65fbxxxxxxx02694e3a72xxxxxxxx; Valley_ParkLogin=04E203A459FCxxxxxxxA2DCD9AAE5B9678G08C04F1952155E2482xxxxxxxxxxxxx
有什么我做错了吗?如何通过POST表单传递登录信息?
解决方法 尝试使用-F选项而不是–data.http://curl.haxx.se/docs/manpage.html#-F
基本上,这会将内容类型标题更改为:
Content-Type: multipart/form-data
这可能会给你一个更好的结果.
总结以上是内存溢出为你收集整理的使用cURL登录POST表单全部内容,希望文章能够帮你解决使用cURL登录POST表单所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)