Closed Timothyoverton closed 8 years ago
You need to specify what it has to return it as.
Try:
Get<TheTYPE>()
Check the examples in the readme file.
Thanks Thomas,
I was able to get it working with TList
constructor TBfObjectList
Is TArray<> not supported? (I'm using XE6.)
I will use TList or my own TObjectList - thanks.
Hi Guys,
I have this working with a single object but when I add in array of objects, I get nothing back.
This was working: type TLoginResponse = class public id: string; end; var loginResponse: TLoginResponse; begin loginResponse := FabRestClient.Resource('https://blah//ro') .Accept(RestUtils.MediaType_Json) .contentType(RestUtils.MediaType_Json) .Post(body);
This isn't, although the call is returning 200 and there is a result in Fiddler: type TAccountArray = TArray;
var
test: TAccountArray;
begin
test := DelphiRestClient.Resource(baseApi + url)
.Header('Authorization', 'Bearer ' + bearerToken)
.Accept(RestUtils.MediaType_Json)
.Get();
In the IDE hovering over Get its only giving me the string parameter, so I've added in the USE_GENERICS directive to the compiler. It won't allow me to add TArray as the Get parameter, it says type mismatch. Any thoughts?