dade
dade

Reputation: 3570

Angular's $resource returns empty with large payload

I have an endpoint which generates a CSV. On disk, the CSV is around 14mb.

I am using Angular's $resource to make a request to this endpoint and for some strange reason, it seems that due to the size of the payload, it does not work as expected.

When the request is made, the network tab in chrome developer tool shows the request completed with a status 200 ok. It also shows that 3.3mb data was transferred, but when I click on the response tab, it says "failed to load response data".

Also, the promise resolves into an empty object within Javascript code.

To confirm if the issue is actually due to the size of the payload, I updated the endpoint to return a smaller payload, and when I do that, everything works as expected: the request completes ok, the payload can be seen in the response tab, and the promise resolves properly.

Any reason why I am encountering this behavior? And suggestions on how this could be fixed?

Using Angular.js version:1.5.9

Upvotes: 2

Views: 40

Answers (0)

Related Questions