大型JSON响应已从Azure API应用程序(.NET Core)截断 [英] Large JSON response truncated from Azure API app (.NET Core)

查看:175
本文介绍了大型JSON响应已从Azure API应用程序(.NET Core)截断的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个返回JSON的标准.NET Core API控制器.

I have a standard .NET Core API Controller that returns JSON.

所有功能均按设计工作,但具有更大的数据集,响应将被截断.

All works as designed but with larger data sets the response is being truncated.

我无法解决(或在Stackoverflow或其他地方找到)如何增加限制-假定这是原因.

I cannot work out (or find on Stackoverflow or elsewhere) how to increase the limit - presuming this is the cause.

有人可以指出我正确的方向吗?

Can someone point me in the right direction please?

推荐答案

我遇到了类似的问题,似乎可以解决的问题是设置了'ReferenceLoopHandling'JSON设置:

I had a similar issue and what seemed to fix it was setting the 'ReferenceLoopHandling' JSON setting:

public void ConfigureServices(IServiceCollection services)
{
        services.AddMvc().AddJsonOptions(options => {
            options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
        });
 ...
}

这篇关于大型JSON响应已从Azure API应用程序(.NET Core)截断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆