Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2023-02

questioning ARequest: TFPHTTPConnectionRequest :)

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

duilio foschi

my simple BE server uses this function to handle all inbound calls:

procedure TTestHTTPServer.HandleRequest(
   var ARequest: TFPHTTPConnectionRequest;
   var AResponse: TFPHTTPConnectionResponse
);

When the call is a POST, I want to read the json payload inside ARequest.

I expected to find a property like Body:string inside TFPHTTPConnectionRequest, but I could not find it.

How do I get the the json payload which is inside ARequest?

Thank you

Peppe

Reply by email

Michael Van Canneyt
to duilio foschi
duilio foschi wrote 11 lines
my simple BE server uses this function to handle all inbound calls: procedure TTestHTTPServer.HandleRequest( var ARequest: TFPHTTPConnectionRequest; var AResponse: TFPHTTPConnectionResponse ); When the call is a POST, I want to read the json payload inside ARequest. I expected to find a property like Body:string inside TFPHTTPConnectionRequest, but I could not find it.

The property is called Content.

Michael.

Reply by email

duilio foschi
to Michael Van Canneyt

It belongs to TFPHTTPConnectionRequest's grandfather (ancestor of ancestor). Silly of me, I had gone back only one generation! :)

Thank you

Peppe

AM Michael Van Canneyt wrote 25 lines
On Sun, 26 Feb 2023, duilio foschi via lazarus wrote: > my simple BE server uses this function to handle all inbound calls: > > procedure TTestHTTPServer.HandleRequest( > var ARequest: TFPHTTPConnectionRequest; > var AResponse: TFPHTTPConnectionResponse > ); > > When the call is a POST, I want to read the json payload inside ARequest. > > I expected to find a property like Body:string inside > TFPHTTPConnectionRequest, but I could not find it. The property is called Content. Michael. -- _______________________________________________ lazarus mailing list https://lists.lazarus-ide.org/listinfo/lazarus

Reply by email