这是我的方法:
[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'
提前致谢!