我有以下型号
namespace ClientAPI.Models {
public class Internal {
public class ReportRequest {
public DateTime StartTime;
public DateTime EndTime;
public string FileName;
public string UserName;
public string Password;
}
}
}
使用以下方法:
[HttpPost]
public HttpResponseMessage GetQuickbooksOFXService(Internal.ReportRequest Request){
return GetQuickbooksOFXService(Request.UserName,
Request.Password, Request.StartTime, Request.EndTime, Request.FileName);
}
我的网络表单如下所示:
<form method="POST" action="http://localhost:56772/Internal/GetQuickbooksOFXService" target="_blank">
<input type="text" name="StartTime" value="2013-04-03T00:00:00">
<input type="text" name="EndTime" value="2013-05-04T00:00:00">
<input type="text" name="FileName" value="Export_2013-04-03_to_2013-05-03.qbo">
<input type="text" name="UserName" value="UserName">
<input type="text" name="Password" value="*****">
<input type="submit" value="Submit"></form>
我的问题是:
我进入了 GetQuickbooksOFXService 函数,但我的模型中包含所有空值,而不是有用的东西。难道我做错了什么?