问题
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