fabriciocolombo / delphi-rest-client-api

A Delphi REST client API to consume REST services written in any programming language.
Apache License 2.0
380 stars 182 forks source link

XE4 compiling problem #108

Open berniQ23 opened 6 years ago

berniQ23 commented 6 years ago

A fresh checkout from today gives on compiling DelphiXE4_RestApi.bpl:

[dcc32 Fehler] RestClient.pas(1001): E2250 Es gibt keine überladene Version von 'Post', die man mit diesen Argumenten aufrufen kann => function TResource.Post(Entity: TObject): TObject; begin Result := Post(Entity, Entity.ClassType); end;

[dcc32 Fehler] RestClient.pas(1028): E2250 Es gibt keine überladene Version von 'Put', die man mit diesen Argumenten aufrufen kann => function TResource.Put(Entity: TObject): TObject; begin Result := Put(Entity, Entity.ClassType); end;

[dcc32 Fehler] RestClient.pas(1065): E2250 Es gibt keine überladene Version von 'Patch', die man mit diesen Argumenten aufrufen kann => function TResource.Patch(Entity: TObject): TObject; begin Result := Patch(Entity, Entity.ClassType); end;

How to fix it? Regards, Bernd

mbirabhadra commented 6 years ago

Getting same error with XE5

kattes commented 5 years ago

Use instead of the faulty method calls:

function TResource.Post(Entity: TObject): TObject; begin Result := EntityRequest(Entity, Entity.ClassType, METHOD_POST); // Result := Post(Entity, Entity.ClassType); end;

function TResource.Put(Entity: TObject): TObject; begin Result := EntityRequest(Entity, Entity.ClassType, METHOD_PUT); // Result := Put(Entity, Entity.ClassType); end;

function TResource.Patch(Entity: TObject): TObject; begin Result := EntityRequest(Entity, Entity.ClassType, METHOD_PATCH); // Result := Patch(Entity, Entity.ClassType); end;

mbirabhadra commented 3 years ago

That worked man!! Just search the commented lines and go ahead with the full replacements of the associated functions/procedures as suggested above. It will compile!