Skip to main content

Method

There are several methods for transmitting data to a web server, including

MethodDescriptionBody
GETRetrieve a document from the serverN
POSTRetrieve a document's header from the serverN
HEADSend data to the server for processingY
PUTStore the data in the Body on the serverY
TRACETrace the message path from the proxy server to the serverN
OPTIONSFind out which methods the server supportsN
DELETEDelete data from the serverN

FastPlaz splits each method into its own overridden procedure, which makes it easier for engineers to build applications.

In the Type section, just declare

type
TContactController = class(TMyCustomController)
private
public
.
.

procedure Get; override; // 👈 handles the GET method
procedure Post; override; // 👈 handles the POST method
end;

And the implementation section looks like this

// this procedure handles all GET requests
procedure TContactController.Get;
begin

//

end;

// this procedure handles all POST requests
procedure TContactController.Post;
begin

//

end;

// likewise for Put, Delete and Options