dapr / js-sdk

Dapr SDK for Javascript
Apache License 2.0
192 stars 80 forks source link

Failing to retrieve PDF/Word docs via Dapr Service Invoke #606

Open Rajesh91-ch opened 1 month ago

Rajesh91-ch commented 1 month ago

In my setup, a Node.js app(Service1) is deployed in an Azure container app with Dapr enabled. Another Node.js app(Service2) consumes it using Dapr Service Invoke methods.

There is a api in service1 it sends the PDF/Word content, Service2 consumes the api and sends the response to client(browser). When service2 receives the response for a pdf document the data content is in 'Raw PDF format'('%PDF-1.4\n' + '1 0 obj\n' + '<<\n')

In http call(Without Dapr SDK) by setting the responsetype to 'stream' or 'arraybuffer' retrieves the content in expected format. However, I can see no such option via Dapr Service Invoke call. Is there a way to handle these kind of scenarios, Please suggest. Below is my Dapr call: Dapr service invoke: const response = await daprClient.invoker.invoke('https://sampleurl.com/reports/${req.params.reportId}/status`, HttpMethod.GET);