【发布时间】:2019-11-20 22:58:46
【问题描述】:
我在向服务器发送在 angular-material 日期选择器中选择了两个日期的请求时遇到问题。网络似乎正在正确发送它们,但是当它到达控制器时,它们的值是 DateTime 默认值。
请求尝试:
return this.http.post(endpoint, {
StartDate,
EndDate
},
{
headers: headers,
responseType: 'text'
});
return this.http.post(endpoint, {
start: StartDate,
end: EndDate
},
{
headers: headers,
responseType: 'text'
});
控制器
[HttpPost("File/Modifications")]
public IActionResult GetFileModificationReport([FromBody] DateTime start, [FromBody] DateTime end){}
【问题讨论】:
标签: c# angular datetime datepicker angular-material