asp.net - 从 API 返回时值为空白
问题描述
从 API 调用此代码时,json 值为空白:
[Route("api/[controller]")]
public class ReportDesignerSetupController : ControllerBase
{
[HttpPost("[action]")]
public object GetReportDesignerModel([FromForm] string reportUrl)
{
return Ok(new JavaScriptSerializer().Deserialize<object>("{name: \"Seb\", age: 42, gender: \"M\"}"));
}
}
{
"name": [],
"age": [],
"gender": []
}
有人有任何理由该值是空白吗?
非常感谢!
参考:
我正在调试一个与 DevEXpress 相关的项目。
解决方案
推荐阅读
- asp.net-core - 使用整数用户 ID 扩展 EF Core Identity UserStore
- php - Easy admin bundle:如何访问 MenuItem::linktoRoute 第四个参数的参数数组
- python - 如何从数组中获取两个 int 数的值
- lua - Lua脚本如何调用/调用zenity或notify-send?
- certificate - 是否可以确定消息是否已由同一链中的证书签名?
- r - R Simmer - 根据队列大小在罐子之间重新分配资源
- json - 告诉 VS Code 从目录解析 JSON Schema 路径
- sql - 从 SQL 查询中排除组合
- c++ - 在 Oracle DB OCCI 界面中使用 UPDATE
- jfrog - jFrog Artifactory 开源不支持多LDAP活动目录认证