4
Buenas.
I’m doing a Post via idHTTP where the result comes in a StringStream.
The problem that this result is coming in half. In case, by cutting the response html.
There Is A Way To Buffer This Post?
Note: I use Delphixe7.
  var
    fHTTP: THTTP;//Classe que utilizo para alimentar o idHTTP
    slParam: TStringList;
  begin
    fHTTP := THTTP.Create;
    slParam := TStringList.Create;
    try
      slParam.Add('modo=C');
      slParam.Add('NumeroRENACH=');
      slParam.Add('txtDocPrincipal=');
      slParam.Add('oculto=');
      slParam.Add('txtCodigo='+ fCaptcha);
      slParam.Add('Submit=Consultar');
      fHTTP.pLimpaParams;
      fHTTP.Params.Host := 'consultas.detrannet.sc.gov.br';
      fHTTP.Params.Connection := 'keep-alive';
      fHTTP.Params.ContentLength := Length(slParam.Text);
      fHTTP.Params.CacheControl := 'max-age=0';
      fHTTP.Params.UserAgent := 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36';
      fHTTP.Params.ContentType := 'application/x-www-form-urlencoded';
      fHTTP.Params.Accept := 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8';
      fHTTP.Params.AcceptEncoding := 'gzip, deflate';
      fHTTP.Params.AcceptLanguage := 'pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4';
      fHTTP.Params.CustomHeaders.Values['Cookie'] := ACookie;
      fHTTP.Params.CustomHeaders.Values['Upgrade-Insecure-Requests'] := '1';
      fHTTP.Params.ProtocolVersion := 1;
      fHTTP.Post('http://consultas.detrannet.sc.gov.br'+RemotePath,slParam);
  finally
    FreeAndNil(fHTTP);
    FreeAndNil(slParam);
  end;
end;
Thanks for the answer. So Postdata is just that on the stringlist. I discovered that the problem was not in idHTTP but in a function that saved to file where I had not done the Unicode adjustment because I copied from the Delphi 7 project.
– Djota Hasse