简体   繁体   English

POST返回Http 400错误请求

[英]POST returns Http 400 Bad request

When I make a POST request to ASP.NET MVC app, I'm getting HTTP 400 Bad Request. 当我向ASP.NET MVC应用发出POST请求时,我收到HTTP 400错误请求。 I have decorated the post action with [ValidateInput(false)] , but still i am getting this error. 我已经用[ValidateInput(false)]装饰了帖子操作,但是仍然出现此错误。

I have a model which is the parameter of the POST method. 我有一个模型,它是POST方法的参数。

Any suggestions for this? 有什么建议吗?

Instead of Model as parameter to action, use Viewmodel Pattern , it will be much clearer what data you post. 使用Viewmodel Pattern代替将Model作为操作参数,可以更清楚地发布哪些数据。 Post the code of the View, and the code of the Model. 张贴视图的代码和模型的代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM