Form' threw an exception of type 'System.InvalidOperationException'
环境: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'的更多相关文章
- .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项目使用一般处理程序变成了中间件 ...
- An unhandled exception of type 'System.TypeInitializationException' occurred in System.ServiceModel.dll
异常“ An unhandled exception of type 'System.TypeInitializationException' occurred in System.ServiceMo ...
- (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 ...
- MVC中异常: An exception of type 'System.Data.ProviderIncompatibleException' occurred in EntityFramework.dll的一种解决办法
今天在调试MVC的例子的时候,总是出错(An exception of type 'System.Data.ProviderIncompatibleException' occurred in Ent ...
- Exception of type 'System.OutOfMemoryException' was thrown
最近刚换了服务器,开始测试的时候未发现什么问题,可是一旦同一时间段操作的人比较多的时候,就会抛出如下错误: Server Error in '/' Application. Exception of ...
- 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 ...
- System.TypeInitializationException: The type initializer for 'Mono.Unix.Native.Stdlib' threw an exception.
08-31 17:02:03: ### DEBUG ##########################System.TypeInitializationException: The type ini ...
- debian The type initializer for 'System.Drawing.KnownColors' threw an exception
Change the "System.Drawing" reference of "CoreCompat.System.Drawing"if you thro ...
- 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电脑
随机推荐
- 时间time模块
time模块: import time --时间模块 --time : 三种不同的时间格式,可以相互转换 时间戳(timestamp): --从1970年1月1日00:00:00开始按秒计算的偏移量 ...
- c++中二叉树的先序中序后序遍历
c++中二叉树的先(前)序.中序.后序遍历 讲解版 首先先看一个遍历的定义(源自度娘): 所谓遍历(Traversal),是指沿着某条搜索路线,依次对树中每个结点均做一次且仅做一次访问.访问结点所做的 ...
- python实现:判断某一天是那一年中的第几天
方法1:先判断是否是闰年,然后再利用求和,得出某一天是第几天 # 方法1:low版 def func1(year, month, day): # 分别创建平年,闰年的月份天数列表(注意列表下标从0开始 ...
- go的接口内部实现
1 前言 1.1 Go汇编 Go语言被定义为一门系统编程语言,与C语言一样通过编译器生成可直接运行的二进制文件.这一点与Java,PHP,Python等编程语言存在很大的不同,这些语言都是运行在基于C ...
- mysql 去除字符串中的空格
mysql> select " ddd dddee "; +--------------+ | ddd dddee | +--------------+ | ddd ddde ...
- ACR Code Pacs
ACR Index for Radiological Diagnosis 简称ACR Index,ACR Key或ACR Code,是一种应用于影像学分类的病理编码,由美国放射学院(American ...
- ipv4的TCP的几个状态 (SYN, FIN, ACK, PSH, RST, URG)
1 在TCP层,有个FLAGS字段,这个字段有以下几个标识:SYN, FIN, ACK, PSH, RST, URG. 2 3 其中,对于我们日常的分析有用的就是前面的五个字段. 4 5 它们的含义是 ...
- 微信小程序上传单张或多张图片
-- chooseImage: function () { let that = this; let worksImgs = that.data.worksImgs; let len = that.d ...
- Springboot属性加载与覆盖优先级与SpringCloud Config Service配置
参考官方文档:https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config. ...
- zk单点部署
一.环境准备 当前环境:centos7.3一台软件版本:zookeeper-3.5.2部署目录:/usr/local/zookeeper启动端口:2181配置文件:/usr/local/zookeep ...