简体   繁体   中英

HTTP response body is empty string

I am working on a project that displays logs from workstations in a factory, the logs are saved on an SQL database and sent to a react application using a .NET based API. The problem is that the response body sometimes reach 6-7 million objects with different properties (almost 1gb of data) and when I try to fetch such large response i get an empty string as a response. when I test it with postman the app crashes. is there any way to fix this?

notes: the page performance is not a priority for me. it is important for me to get all the data. when I try to get the first 10000 objects everything works fine.

Usually while dealing with a lot of data, the approach of pagination is being preferred. You can use the skip and take variables to do the consecutive requests for fetching the data.

You can refer: https://codewithmukesh.com/blog/pagination-in-aspnet-core-webapi/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM