Description
In the example: "Get Protected Resource" button
gets the same /admin/role1 endpoint, but it implies the first uses the JSON route and hte second one text/html route.
I think both use the text/html route.
{ Getting JSON response } doesn't set the lclient.accept, but the comment implies it is set to JSON.
{ Getting HTML response } explicitly sets the lclient.lClient.Accept('text/html')
To demonstrate:
Run the VCL client outside of the IDE.
Load the JWTRoleAutServer project
Add a breakpoint to:
procedure TAdminController.OnlyRole1;
and
procedure TAdminController.OnlyRole1EmittingJSON;
based on the calling code, I think it should call the JSON only, then the text/html on. IN fact it calls the
text/html one twice.
To make it work as expected you could assign the accept explitcitly.
lResp := lClient.Accept('application/json').Get('/admin/role1');
It just means the default is text/html, not JSON, not a biggy, just incorrect in the example.