【发布时间】:2013-03-13 16:36:48
【问题描述】:
这是我的方法:
[HttpPost]
[ActionName("TestString")]
public string TestString([FromBody] int a, [FromBody] int b, [FromBody] int c)
{
return "test " + a + " " + b + " " + c;
}
有什么方法可以让我使用HttpClient.PostAsJsonAsync 调用这个方法
我试过这个:
HttpResponseMessage response = client.PostAsJsonAsync("api/task/TestString","a=8,b=5,c=6").Result;
但我收到此错误:StatusCode: 500, ReasonPhrase: 'Internal Server Error'
提前致谢!
【问题讨论】:
标签: c# asp.net-web-api