不知道怎么回事,传一个参数时正常,但串俩是会报错400.
请各位帮忙解决一下分不够可以再加谢谢.
传俩参数的代码:procedure TFrmMain.btnLoginClick(Sender: TObject);
var
  resParams: TStringStream;
  postParams: TStringList;
begin
  btnLogin.Enabled := False;
  resParams := TStringStream.Create('');
  postParams := TStringList.Create;
  try
    mmLog.Lines.Clear;
    IdHTTP.Request.CacheControl :='no-cache';
    IdHTTP.Request.Connection :='Keep-Alive';
    IdHTTP.Request.Accept :='text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8';
    IdHTTP.Request.ContentType :='application/x-www-form-urlencoded';
    IdHTTP.Request.AcceptCharSet := 'UTF-8';
    IdHTTP.Request.AcceptEncoding := 'UTF-8';
    IdHTTP.Request.AcceptLanguage := 'UTF-8';
    IdHTTP.HandleRedirects :=True;  //允许重定向,因为这个站点会发生重定向
    IdHTTP.AllowCookies :=True;
    IdHTTP.HTTPOptions :=[hoForceEncodeParams];
    postParams.Clear;
    postParams.Add('account=帐号');
    postParams.Add('password=密码');//把这个注释了传1个参数就没问题!!!奇怪、?
    //postParams.Add('url=/console/remote/');
    resParams.WriteString('');
    IdHTTP.Request.Referer :='https://sunlogin.oray.com/passport/login?lang=zh_CN';   //设置来路,此网站要求
    IdHTTP.Post('https://sunlogin.oray.com/passport/login?lang=zh_CN',postParams,resParams);
    mmLog.Lines.Add(Utf8ToAnsi(resParams.DataString));
  finally
    resParams.Free;
    postParams.Free;
    btnLogin.Enabled := True;
  end;
end;