大佬教程收集整理的这篇文章主要介绍了jquery – Ajax获取返回ERR_SPDY_PROTOCOL_ERROR,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
这是我的Api:
[@R_489_10107@Get] public async Task<IActionResult> GetPackWithAllCards(int? packId) { if (packId == null) { return Json("An error has occured"); } else { var pack = await _context.Packs .Include(p => p.TagPacks) .ThenInclude(tp => tp.Tag) .Include(p => p.CardPacks) .ThenInclude(cp => cp.Card) .ThenInclude(c => c.FaceCards) .ThenInclude(fc => fc.FacE) .ThenInclude(fc => fc.TemplatE) .Include(p => p.CardPacks) .ThenInclude(cp => cp.Card.FaceCards) .ThenInclude(fc => fc.Face.ImagE) .Include(p => p.CardPacks) .ThenInclude(cp => cp.Card.FaceCards) .ThenInclude(fc => fc.Face.sound) .SingLeorDefaultAsync(m => m.PackId == packId); if (pack == null) { return Json("An error has occured"); } return Ok(pack); } }
和我的ajax电话:
$.get("/pack/GetPackWithAllCards",{ packId: pack.packId },function (pack) { alert(pack); });
基于github:https://github.com/aspnet/EntityFrameworkCore/issues/9573.我发现它只能部分解决我的问题.在模型中删除不必要的引用修复了该问题.
以上是大佬教程为你收集整理的jquery – Ajax获取返回ERR_SPDY_PROTOCOL_ERROR全部内容,希望文章能够帮你解决jquery – Ajax获取返回ERR_SPDY_PROTOCOL_ERROR所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。