使用REST控制台将MVS传递给操作 - MVC

Bru*_*uno 0 rest asp.net-mvc

我想知道如何使用REST控制台(chrome插件)发送参数'foo'.他应该作为JSON发送.

大段引用

public class ComandaEletronicaWSController : Controller
{
    [HttpPost]
    public JsonResult ComandaServlet(Foo foo)
    {
        var action = Request.QueryString["Action"];

        return Json(new { Ok = true });
    }
}
public class Foo
{
    public int bar { get; set; }
    public int beer { get; set; }
}
Run Code Online (Sandbox Code Playgroud)

Dei*_*zan 6

您需要传入请求有效负载.

在此输入图像描述

选择内容类型为

应用程序/ JSON

并将您的JSON放在RAW Body上