XData service response as TBytes with specific content type

I'm trying to implement a service returning a PDF file as binary

  IEcoPDFService = interface(IInvokable)
    [HttpGet, Route('render')]
    function Render(RequestID : string='') : TBytes;

Independently the function works fine enabling to save a pdf file
But here I'm trying to build an answer from xdata as REST API but in swaggerUI the response is
"value": "string"
with content type = application/json
How to return binary directly as application/pdf ?

Thanks for help

Search for:

function TMyService.GetPdfReport: TStream;
1 Like

Thanks and my bad...
I didn't see this subject in documentation
It works perfectly after conversion of TBytes in TStream

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.