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电脑
随机推荐
- 【后缀数组】【SP1811】 LCS - Longest Common Substring
题目链接 题意翻译 输入2 个长度不大于250000的字符串,输出这2 个字符串的最长公共子串.如果没有公共子串则输出0 . 思路 求两个串的最长公共子串 代码 #include<iostrea ...
- mac百度网盘破解版
以下资源来源于网络收集分享,如有问题请联系我删除!来源入口,后面链接挂了,可去原网址访问! 还在为Mac百度网盘下载速度慢而烦恼吗?百度云盘又是一个非常实用的分享工具,可支持图片.视频.音乐.文档.种 ...
- Linux+Tomcat环境下安装SSL证书
1.将申请好的证书(4个文件)文件放入/home/tomcat/apache-tomcat-9.0.12/conf/cert文件夹下2.(或者)将申请好的证书(4个文件)文件放入/home/tomca ...
- python爬虫 TapTap
作业要求来自于https://edu.cnblogs.com/campus/gzcc/GZCC-16SE2/homework/3075 对象 - TapTap TapTap 是一个高品质手游玩家社区, ...
- 第06组 Alpha冲刺(2/4)
队名:福大帮 组长博客链接:https://www.cnblogs.com/mhq-mhq/p/11885037.html 作业博客 :https://edu.cnblogs.com/campus/f ...
- RocketMQ集群安装 2主2从 console
安装zip和mavenyum install -y unzip zip wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel ...
- LDD3源码分析之poll分析
编译环境:Ubuntu 10.10 内核版本:2.6.32-38-generic-pae LDD3源码路径:examples/scull/pipe.c examples/scull/main.c 本 ...
- -bash: iostat: command not found解决办法
[root@testhost ~]# iostat-bash: iostat: command not found IOSTAT 命令不可用,首先确认sysstat包是否安装,sysstat包中包括i ...
- Ubuntu 配置镜像源
Ubuntu 配置镜像源 注, 如果添加镜像后没有自己要安装的软件, 切回原镜像即可, 只是有点慢. cp /etc/apt/sources.list /etc/apt/sources.list.ba ...
- 【449】backup get weekly tweets
import pandas as pd from datetime import datetime fn = r"D:\OneDrive - UNSW\tweets_flu.csv" ...