我正在学习ASP.Net MVC 5的基础知识。我想使用“高级rest客户端”向我的一个控制器操作发出POST请求,该操作位于“SecurityController”中。但是我无法做到这一点。请指导我。
以下是我的尝试:
我不确定这是否是正确的方法。
步骤3. 我需要添加一些内容类型或其他配置吗?目前,我收到了“资源未找到”的错误。
这是截图:
编辑:另一次尝试
以下是我的尝试:
[HttpPost]
public ActionResult Hello(SampleMV viewModel)
{
return Content("Hello");
}
public class SampleMV
{
public int one { get; set; }
public int two { get; set; }
public int? three { get; set; }
}
现在我需要在我的高级REST客户端中进行哪些更改?
步骤1:将请求下拉菜单设置为POST
步骤2:在原始有效载荷部分,我明确添加了以下内容:
one = 2, two = 3, three = 4 seperated by comma.
我不确定这是否是正确的方法。
步骤3. 我需要添加一些内容类型或其他配置吗?目前,我收到了“资源未找到”的错误。
这是截图:
![enter image description here](https://istack.dev59.com/N1krA.webp)
/security
?控制器是SecurityController
吗? - Maria Ines Parnisari