简体   繁体   English

HTTP 响应正文为空字符串

[英]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.我正在开发一个显示工厂工作站日志的项目,日志保存在 SQL 数据库中,并使用基于 .NET 的 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.问题是响应主体有时会达到 6-7 百万个具有不同属性的对象(几乎 1gb 的数据),当我尝试获取如此大的响应时,我得到一个空字符串作为响应。 when I test it with postman the app crashes.当我用 postman 测试它时,应用程序崩溃了。 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.当我尝试获取前 10000 个对象时,一切正常。

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.您可以使用skiptake变量来执行获取数据的连续请求。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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