是什么的[AcceptVerbs(HttpVerbs.Post)之间的差异和[HttpPost] [英] What is the difference between [AcceptVerbs(HttpVerbs.Post)] and [HttpPost]?

查看:203
本文介绍了是什么的[AcceptVerbs(HttpVerbs.Post)之间的差异和[HttpPost]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以装饰一个动作或者与的[AcceptVerbs(HttpVerbs.Post)] /的[AcceptVerbs(HttpVerbs.Get)]

I can decorate an action either with the [AcceptVerbs(HttpVerbs.Post)]/[AcceptVerbs(HttpVerbs.Get)]

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Create(string title)
{
    // Do Something...
}

或使用[HttpPost] / [HTTPGET]属性

or with the [HttpPost]/[HttpGet] attributes

[HttpPost]
public ActionResult Create(string title)
{
    // Do Something...
}

他们是不同的?

推荐答案

没有。一个是刚刚简写为其他。

Nothing. One is just shorthand for the other.

这篇关于是什么的[AcceptVerbs(HttpVerbs.Post)之间的差异和[HttpPost]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆