Http post request-body

戏子无情 提交于 2019-12-23 05:44:32

问题


I'm tring to use lua to write a script to fetch some data from the website: www.baidu.com(which is popular in China), but it require authentication and anyone can signup the site.When I sign in the site , I use Fiddler to capture the session, and I found that the request-body have few variable parameters, like this:

ppui_logintime=14084&charset=UTF-8&codestring=&token=9fcf00d59b6b9860937a70c221??95d818&isPhone=false&index=0&u=http%3A%2F%2Fwww.baidu.com%2F&safeflg=0&staticpage??=https%3A%2F%2Fpassport.baidu.com%2Fv2Jump.html&loginType=1&tpl=mn&callback=paren??t.bdPass.api.login._postCallback&username=test&password=test&verifycode=&mem_pass??=on 

The ppui_logintime and token field value, They get from where? And what are they used to do?

Any help / advice / suggestions greatly appreciated.


回答1:


The values come from the HTML webform that users log in to the site with. It contains hidden fields, not just the fields the user sees onscreen. When the webserver delivers the HTML to the browser, those hidden fields contain the values that get submitted back to the webserver along with the values that the user types in. That is how HTML webforms work in general.



来源:https://stackoverflow.com/questions/11175144/http-post-request-body

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!