【发布时间】:2016-01-23 19:54:02
【问题描述】:
我遇到了问题。
我有一个字符串值,我传递给web api 控制器。
如果我通过"myValue",它在控制器中接收为"myValue",但如果我通过"&&myValue",则接收为null。
有什么想法吗?
代码:
网络客户端
factory.downloadStrudentReport = function(date, Name) {
$rootScope.$broadcast('dowload', _url + 'GetStudentPdfReport', { date: date, Nanme: Name});
};
服务器
[HttpGet]
[Route("GetStudentPdfReport")]
public HttpResponseMessage GetStudentPdfReport(DateTime date, string stuName)
}
//////////////
{
另一个帖子, Passing json data to a WebApi with special characters results to null
说,client.Encoding = Encoding.UTF8; 但不确定在哪里?
有什么想法吗?
【问题讨论】:
-
请向我们展示您的代码。
标签: json asp.net-mvc-4 asp.net-web-api