XData service response as TBytes with specific content type

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

[ServiceContract]
  [Route('ecopdf')]
  IEcoPDFService = interface(IInvokable)
    ['{1D39A2FF-2C86-4878-9C94-BCC8C41F10CA}']
    [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
Sylvain

https://doc.tmssoftware.com/biz/xdata/guide/service.html
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.