viniciussanchez/RESTRequest4Delphi

RESTRequest4D.Request.NetHTTP.pas(246): E2010 Incompatible types: 'string' and 'Boolean'

Closed this issue · 6 comments

I have a problem compiling the latest versions, I never had such problems before.

function TRequestNetHTTP.AddFile(const AFieldName: string; const AValue: TStream; const AFileName: string; const AContentType: string): IRequest;
{$IF COMPILERVERSION >= 33.0}
var
LFileName: string;
{$ENDIF}
begin
Result := Self;
if not Assigned(AValue) then
Exit;
{$IF COMPILERVERSION >= 33.0}
LFileName := Trim(AFileName);
if (LFileName = EmptyStr) then
LFileName := AFieldName;
AValue.Position := 0;
{$IF COMPILERVERSION >= 34.0}
FMultipartFormData.AddStream(AFieldName, AValue, True, LFileName, AContentType); //----------> HERE ERROR!!!
{$ELSE}
FMultipartFormData.AddStream(AFieldName, AValue, LFileName, AContentType);
{$ENDIF}
FUseMultipartFormData := True;
{$ENDIF}
end;

nq2021 commented

I also encountered this error

Whats the delphi version you are using?

Send us a pull request... please

Was there a solution?

I looked at the current file, and it already has the suggested IFDEF... someone sent the PR.

Utilizo o delphi 11 --> Alexandria e o erro ainda persiste, mesmo tendo o IFDEF sugerido essa versao do delphi nao corresponde com os parametros passados, pois nao tem o 3º parametro como Boolean. Sendo FMultipartFormData.AddStream(AFieldName, AValue, LFileName, AContentType) o aceito.