c# - 如何使用 C# 检索传入的参数?
问题描述
我正在使用 ASP.NET Core MVC 2.0与 waboxapp API(链接)集成。
一些参数已经像这样发布了
contact[uid], contact[name], contact[type], message[uid], message[body] etc...
我尝试了以下代码:
[HttpPost]
public IActionResult Index(string uid, string token, List<string> contact)
{
foreach (string item in contact) {
Common.TestEmail(uid, token);
}
return View();
}
检索传入参数的正确方法是什么?
解决方案
对于waboxapp
,它的请求是标准 HTTP 格式 (application/x-www-form-urlencoded)。尝试按照以下步骤操作:
推荐阅读
- python-3.x - 在 Python 单元测试中正确使用 assertRaises
- python - 对具有相同 y 值的轮廓进行分组
- javascript - 来自int数组的V8 ArrayBuffer?
- python - 需要使用数据框列中存在的列表值创建列表
- python - 对于带有scrapy shell 的某些元素,XPath 不返回任何结果
- sql-server - 如何从 FILESTREAM 中检索文件?
- java - Field.set() 中的 ClassCastException
- angular - 可拖动网格角度
- c++ - 删除带有 std::remove 的文件,其中包含 Windows 用户名
- azure-functions - Azure Functions v3 中是否可以使用 webjobssdk 3.0.16 自定义触发器?