【发布时间】:2020-02-11 23:55:47
【问题描述】:
我的 C# 控制器中有一个 GET 方法
public async Task<IHttpActionResult> GetEmailTemplate(List<string> ids)
我在 angularJs 中这样称呼它:
$http({
method: 'GET',
url: apiUrl + 'api/jobs/composeEmail',
data: JSON.stringify(ids) //i also tried ids (which is an array)
});
但是在点击 api 时,id 列表为空......当我在开发人员工具中检查请求时,它没有发送数据......就像 $http 请求中的数据配置被忽略了.我错过了什么?
当我尝试使用 POSTMAN 通过发送 Body 和
的示例 raw 数据来测试 api 时,请求正在工作[
"123213",
"444444"
]
【问题讨论】: