[fpc-pascal] TJSONRPCModule: access the request from an handler.

Luca Olivetti luca at ventoso.org
Fri Sep 9 15:21:52 CEST 2022


I added a "Web JSON-RPC Module" to my project, I dropped on it a 

I find no way to access the request (I want to check the RemoteAddress):

1) the module has a "Request" field but it is always nil (either in 
DataModuleCreate, which isn't called with every request so it's unusable 
anyway, in BeforeExecute and in Execute, I didn't check AfterExecute but 
it would be too late).

2) the JSONRPCHandler has no way to access the request (or I couldn't 
find it).

I guess that, instead of calling the RegisterHTTPModule of the module, I 
should register the route in my webserver class (with 
httprouter.RegisterRoute), but what should I do in the handler to 
delegate the handling to the JSONRPCModule?


More information about the fpc-pascal mailing list