RESTful services created using Delphi DataSnap provide default prefix mapping for public REST methods from a DataSnap server based on the type of HTTP method. These are the following:
HTTP Method type Prefix Example GET none MyValue POST Update UpdateMyValue PUT Accept AcceptMyValue DELETE Cancel CancelMyValue
The documentation states: "The mapping template can be overridden. The user can override the mapping for each type based on the class name and method name parameters." However, I was completely unable to find documentation on how to do this. I want to change the prefix of my PUT from Accept to another. How to do it?
I should note that another posting here on StackOverflow ( REST Datasnap overrides the mapping of URIs ) is trying to answer this question by indicating that the TDSHTTPService has methods to perform this mapping. The same post also mentions the white Marco CantΓΉ DataSnap document, which is supposed to also describe how to do this. This white paper says, "You can configure these mappings by processing the four appropriate event handlers for the DSHTTPWebDispatcher component."
In RAD Studio XE, the TDSHTTPService and TDSHTTPWebDispather components had four specific events corresponding to the four HTTP methods listed above and which were designed to match the prefix. These methods do not exist in XE2 and later.
source share