ServiceRequiresLogin in Delphi

Looks like you read .NET based part about HTTP API.
Delphi part still uses RequiresSession .

I’ve attached Delphi sample that demonstrates usage of sessions:
httpapi_security.zip (33.1 KB)

ServiceBuilder has special editor for HTTP API attributes:

for CodeFirst based services, you need to provide these attributes manually via ROCustom attribute like

// for methods
    [ROCustom('HttpApiPath','calculate')]
    [ROCustom('HttpApiMethod','GET')]
    [ROCustom('HttpApiResult','201')]
    [ROCustom('HttpApiTags', 'tag')]
    [ROCustom('HttpApiOperationId', 'operation')]
// for parameters
    [ROCustom('HttpApiQueryParameter','1')]
    [ROCustom('HttpApiHeaderParameter','1')]

Response code can be provided via

raise EROHttpApiException.Create(HTTP_404_code, HTTP_404_status);

see also HTTP API sample at Adding HttpAPI to a Server (Delphi) article.

Note: You may need to install latest ROD beta.