环境:VS2017 NetCore 2.2 Razor Layui

在处理异步请求是遇到"((Microsoft.AspNetCore.Http.Internal.DefaultHttpRequest)this.Request).Form' threw an exception of type 'System.InvalidOperationException'

Microsoft.AspNetCore.Http.IFormCollection {System.InvalidOperationException}"

后端代码:

前端代码:

问题发生的原因不请.

在具体使用中发现 前端提交的json最好是放到json解析器中验证一下是否正确,若json不正确这是 FromBody 的数据也会为null.

在这里先记录下来.

Form' threw an exception of type 'System.InvalidOperationException'的更多相关文章

  1. .net core 3.0web_razor page项目_使用中间件接受大文件上传报错_httpRequest.Form threw an exception of type Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException_Request body too large

    前言:在web项目的.net framework时文件上传时,自己常用一般处理程序接受上传文件,上传文件的大小限制是可以项目的webconfig里配置.   到core项目使用一般处理程序变成了中间件 ...

  2. An unhandled exception of type 'System.TypeInitializationException' occurred in System.ServiceModel.dll

    异常“ An unhandled exception of type 'System.TypeInitializationException' occurred in System.ServiceMo ...

  3. (C# Debug)A first chance exception of type 'System.ArgumentException' occurred in System.Data.dll

    Debug 模式下运行程序的时候,Output 窗口出来个错误“A first chance exception of type 'System.ArgumentException' occurred ...

  4. MVC中异常: An exception of type 'System.Data.ProviderIncompatibleException' occurred in EntityFramework.dll的一种解决办法

    今天在调试MVC的例子的时候,总是出错(An exception of type 'System.Data.ProviderIncompatibleException' occurred in Ent ...

  5. Exception of type 'System.OutOfMemoryException' was thrown

    最近刚换了服务器,开始测试的时候未发现什么问题,可是一旦同一时间段操作的人比较多的时候,就会抛出如下错误: Server Error in '/' Application. Exception of ...

  6. System.Security.SecurityException The type initializer for 'System.Data.Entity.Internal.AppConfig' threw an exception

    [15/08/19 00:03:10] [DataManager-7292-ERROR] System.Reflection.TargetInvocationException: Exception ...

  7. System.TypeInitializationException: The type initializer for 'Mono.Unix.Native.Stdlib' threw an exception.

    08-31 17:02:03: ### DEBUG ##########################System.TypeInitializationException: The type ini ...

  8. debian The type initializer for 'System.Drawing.KnownColors' threw an exception

     Change the "System.Drawing" reference of "CoreCompat.System.Drawing"if you thro ...

  9. The type initializer for System.Data.SqlClient.SqlConnection threw an exception

    The type initializer for System.Data.SqlClient.SqlConnection threw an exception net framwork啥原因 xp电脑

随机推荐

  1. 干货 | 10分钟教你用column generation求解vehicle routing problems

    OUTLINE 前言 VRPTW description column generation Illustration code reference 00 前言 此前向大家介绍了列生成算法的详细过程, ...

  2. 洛谷P2331[SCOI2005]最大子矩阵

    题目 DP 此题可以分为两个子问题. \(m\)等于\(1\): 原题目转化为求一行数列里的\(k\)块区间的和,区间可以为空的值. 直接定义状态\(dp[i][t]\)表示前i个数分为t块的最大值. ...

  3. windows sh.exe 中文乱码

    idea 需要重启 export LANG=zh_CN.utf-8 alias ls='ls --show-control-chars --color=auto'

  4. QML学习(三)——<QML命名规范>

    QML对象声明 QML对象特性一般使用下面的顺序进行构造: id 属性声明 信号声明 JavaScript函数 对象属性 子对象 状态 状态切换 为了获取更好的可读性,建议在不同部分之间添加一个空行. ...

  5. According to TLD or attribute directive in tag file, attribute items does not accept any expressions

    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>报错 <%@ tagl ...

  6. RSA前台加密后台解密

    RSA解密时BadPaddingException java rsa 解密报:javax.crypto.BadPaddingException: Decryption error Java安全架构__ ...

  7. 从ReentrantLock的实现看AQS的原理及应用 可重入锁

    https://mp.weixin.qq.com/s/sA01gxC4EbgypCsQt5pVog

  8. [转]eclipse中 properties文件编码问题

    原文地址:https://blog.csdn.net/uestcong/article/details/6635123 1. Eclipse修改设置项目中用到了配置文件,所以在Eclipse中新建.p ...

  9. Java基础 三目运算符 在嵌套时,使用括号

        JDK :OpenJDK-11      OS :CentOS 7.6.1810      IDE :Eclipse 2019‑03 typesetting :Markdown   code ...

  10. odoo开发笔记--form视图按钮样例

    如图: 对应后台views视图,class可选内容值: class="oe_highlight" class="btn-xs" class="btn- ...