Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hello, I have try to test you REST api, but have a error when complile it. #7

Closed
wqmeng opened this issue Mar 28, 2013 · 8 comments
Closed

Comments

@wqmeng
Copy link

wqmeng commented Mar 28, 2013

class function TJsonUtilGenerics.Marshal(entity: TObject): string;
begin
Result := entity.ToJson().AsJSon();
end;

[DCC Error] RestJsonGenerics.pas(26): E2003 Undeclared identifier: 'ToJson'

Is the function ToJson still not implement yet? Or I have miss something?

Thanks

@wqmeng
Copy link
Author

wqmeng commented Mar 28, 2013

Also do you have some demo code?

Thank you.

@fabriciocolombo
Copy link
Owner

Hi, what your delphi version?

@wqmeng
Copy link
Author

wqmeng commented Mar 29, 2013

Hello, Delphi XE .

Thanks

@fabriciocolombo
Copy link
Owner

I reviewed the packages for D7, XE and XE2 and could not reproduce the problem. The method toJSON is declared in class helper TSuperObjectHelper inside the unit SuperObject. Maybe you have in your library path an older version of SuperObject that does not contain this helper, anyway, you must use the library SuperObject that is inside the folder lib\superobject because it contains modifications.

About the demo, I'll work on that.

@prakashgoswami
Copy link

i am having trouble compiling the demo code in Delphi7, (ufrm_personlist.pas line : 105)
DM.RestClient.Resource(CONTEXT_PATH + 'person')
.Accept(RestUtils.MediaType_Json)
.ContentType(RestUtils.MediaType_Json)
.Put (vPerson)
.Free;
how to replace for delphi7 compatibility.
thanks in advance.

@fabriciocolombo
Copy link
Owner

Sorry for the delay in answering your question.

The method you are using makes use of Generics, and is only available from
Delphi 2010 and newer.

I intend to implement serialization for Delphi 7 soon, but for now, you
need to use the methods Post (Content: TStream) or Post (content: String),
and format the content properly.

Follow the project on github that will soon have news about serialization
for Delphi 7.

2013/7/14 prakashgoswami notifications@github.com

i am having trouble compiling the demo code in Delphi7,
(ufrm_personlist.pas line : 105)
DM.RestClient.Resource(CONTEXT_PATH + 'person')
.Accept(RestUtils.MediaType_Json)
.ContentType(RestUtils.MediaType_Json)
.Put (vPerson)
.Free;
how to replace for delphi7 compatibility.
thanks in advance.


Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-20941583
.

Atenciosamente

Fabricio Colombo

Desenvolvedor Delphi e Java
Maringá - PR
Blog: http://fabriciodev.blogspot.com
[image: Siga-me no Facebook] http://facebook.com/fabriciodev Siga-me no
Facebook http://facebook.com/fabriciodev [image: Siga-me no
Twitter]http://twitter.com/fabriciodev Siga-me
no Twitter http://twitter.com/fabriciodev
http://fabriciodev.blogspot.com/
http://fabriciodev.blogspot.com/

@leacarbonera
Copy link

Olá, Fabricio tudo bem. Estou tentando instalar a biblioteca RestClient no meu Delphi XE2, mas ao compilar me apresenta o seguinte erro no arquivo Restclient.pas, na função :

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

"[DCC Error] RestClient.pas(1001): E2250 There is no overloaded version of 'Post' that can be called with these arguments"

O que pode ser será?

Abraço

RobertoSchneiders added a commit that referenced this issue Nov 30, 2017
@berniQ23
Copy link

I can confirm the comment from Abraco from November 2017.
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants