gpt4 book ai didi

c# - 在同一 Controller 中具有相同操作名称的 GET 和 POST 方法

转载 作者:IT王子 更新时间:2023-10-29 03:40:38 26 4
gpt4 key购买 nike

<分区>

为什么这是不正确的?

{
public class HomeController : Controller
{

[HttpGet]
public ActionResult Index()
{
Some Code--Some Code---Some Code
return View();
}

[HttpPost]
public ActionResult Index()
{
Some Code--Some Code---Some Code
return View();
}

}

我怎样才能让 Controller 在“收到”时回答一件事,在“发布”时回答一件事?

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com