Noob question:

Noob question:

Is there a cleaner way to insert a JsonRPC request handler into a TWebModule?

Note – Insert as an action in code, and not at design time.

procedure TWebModule1.WebModule1DefaultHandlerAction(Sender: TObject;

Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);

begin

if (Request.MethodType = mtPost) and (Request.ContentType = ‘application/json’) and (Request.PathInfo = ‘/’)

then begin

JsonRPC.Invoke(Sender, Request, Response, Handled);

end

else begin

Response.Content := {“”,””}

” +

‘Nothing to see’ +

‘Move along’ +

”;

end;

end;

3 thoughts on “Noob question:

Leave a Reply to Jeroen Wiert Pluimers Cancel reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.