[Lazarus] SQLDBRestBridge

Michael Van Canneyt michael at freepascal.org
Thu Nov 3 23:17:06 CET 2022



On Thu, 3 Nov 2022, duilio foschi wrote:

> Hi Michael,
>
> I was able to log the info shown in this pic
> https://i.ibb.co/f4MJQFJ/1.jpg
>
> (I used a rough writeln for now).
>
> This is fine when you want to verify the behaviour of the application itself.
>
> 1.
> ==
> Is there a way to have the server log HTTP commands received from the client?
>
> Like:
> http://localhost:3000/EXPENSES?fmt=buf&humanreadable=1

Yes.

Please look at the intercept example. You can register an interceptor (a kind
of middleware) and log all URLs.


> 2.
> ==
> Is there a way to have the server log the data returned to the client?
>
> This data will be very valuable when trying to debug a client
> developed by 3th parties that misbehave (what is my condition now).
>
> The alternative will be to use a HTTP proxy.

Same here: you can register an interceptor for this, use the iaAfter to
indicate that the interceptor takes place after the request was handled.

The content should still be available in the response.content or
response.contentstream.

Michael.


More information about the lazarus mailing list