Sign in Join

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

Mailing lists / lazarus / 2023-02

TFPHTTPServer

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

I wrote a simple server using TFPHTTPServer.

All incoming calls are processed using
procedure HandleRequest(var ARequest: TFPHTTPConnectionRequest;
         var AResponse: TFPHTTPConnectionResponse);

My first tests were ok and encouraging but... how do I know if the call was a GET or a POST?

I guess that ARequest "knows" it, but I cannot find a way to ask :)

Thank you

Peppe Polpo

Reply by email

Michael Van Canneyt
to duilio foschi
duilio foschi wrote 10 lines
I wrote a simple server using TFPHTTPServer. All incoming calls are processed using procedure HandleRequest(var ARequest: TFPHTTPConnectionRequest; var AResponse: TFPHTTPConnectionResponse); My first tests were ok and encouraging but... how do I know if the call was a GET or a POST? I guess that ARequest "knows" it, but I cannot find a way to ask :)

Try ARequest.Method, this is the HTTP method string as sent by the client.

Michael.

Reply by email

duilio foschi
to Michael Van Canneyt

that was it. Thanks a lot

Peppe

AM Michael Van Canneyt wrote 24 lines
On Thu, 23 Feb 2023, duilio foschi via lazarus wrote: > I wrote a simple server using TFPHTTPServer. > > All incoming calls are processed using > procedure HandleRequest(var ARequest: TFPHTTPConnectionRequest; > var AResponse: TFPHTTPConnectionResponse); > > My first tests were ok and encouraging but... how do I know if the > call was a GET or a POST? > > I guess that ARequest "knows" it, but I cannot find a way to ask :) Try ARequest.Method, this is the HTTP method string as sent by the client. Michael. -- _______________________________________________ lazarus mailing list https://lists.lazarus-ide.org/listinfo/lazarus

Reply by email