抓包这个post没有参数,只有数值(id=217),用
sParams.WriteString('id=217');
IdHTTP1.post(http://xxxxx/?m=pieces&a=vote,sParams); 但是不对用网页代码提交
<form action="xxx" method="POST">
<input type="text" size="10" value="217" name="id">
<input type=submit value="post">
</form>
是正常的如何解决

解决方案 »

  1.   

    也就是说
    POST xxxxxx HTTP/1.1
    Accept: */*
    Accept-Language: zh-CN
    Referer: xxxxxxx
    .....
    都要写上?
      

  2.   

    procedure TForm1.btn1Click(Sender: TObject);
    var
      strMsg:string;
      response:Tstringstream;
      postlist:tstringlist;
    begin
      postlist := TStringlist.create;
      postlist.Clear;
      response := TStringStream.create('');
      idHTP1.HandleRedirects := True;
      postlist.add('username=admin') ;------原来用stringstream 不行的 必须是这个。不然就报错
      postlist.add('password=888888888888') ;
      IdHTP1.Request.ContentType := 'application/x-www-form-urlencoded';
      IdHTP1.Request.UserAgent:='Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Maxthon)';  try  IdHTP1.post('http://172.29.186.206/login.php',postlist,response) ;