I added a PUT handler to my API (so far I worked with POST, for my new API iteration I'm finally getting to implementing PUT), but it does not get dispatched.
HttpAppSrv1.AddPutHandler('/'+porticoversion+'/object/*',Tlisaapiportico); // Person anlegen PUT /object/{oid}/person
Tlisaapiportico is implementing TUrlHandler.
I debugged, and it looks like the handler get's correctly added to the FPutHandler, but PutDispatchVirtualDocument gets never reached.
Further debugging (and comparison with POST) lead me to TriggerPutDocument. When I comment out the "Flags-Check" it works.
procedure THttpAppSrv.TriggerPutDocument( { V8.67 }
Sender : TObject;
var Flags : THttpGetFlag);
begin
//OutputDebugString(PChar('HTTP_PUT ' + (Sender as THttpAppSrvConnection).Path));
inherited TriggerPutDocument(Sender, Flags);
{ if Flags in [hgWillSendMySelf, hg404, hg403, hg401] then
Exit ; }
// Handle all virtual documents. Returns TRUE if document handled.
if PutDispatchVirtualDocument(Sender as THttpAppSrvConnection, Flags) then
Exit;
// Reject anything else
Flags := hg404;
end;
In TriggerDeleteDocument is a similar check. I did not test it yet, but I imagine I'm going to run into the same problem.
Of course I don't know if the real problem is, that the flag get's set wrong somewhere higher in the call stack, or if the inherited call should do something instead.