Open Closed

File IActionResult response from JavaScript AJAX API #2110


User avatar
0
moodyan created

Hello,

I am trying to open a PDF in a new tab in our JavaScript UI. I have an endpoint that returns an IActionResult File (an application/pdf). When I try to make a request via the Dynamic JavaScript API Client Proxy, the endpoint itself returns a successful repsonse, but the proxy throws a deserialization exception. I have tried passing through various dataTypes via the ajax call and that doesn't seem to make a difference, the request always seems to try to deserialize the response into JSON, which obviously doesn't work. I have also tried returning an HttpResponseMessage from the endpoint and tried different dataTypes and that also isn't working, I still get a derialization exception. Just wanted to check to see if this is currently supported with the client proxy, and if so, what am I missing?

Thanks!


1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you share hte endpoint code? Maybe you can use IRemoteStreamContent .

Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09