且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

与捕获所有航线的ASP.NET Web API PUT

更新时间:2023-02-15 21:44:35

我不认为路线的问题。你应该罚款与途径,如果这就是你想怎么写。你会得到错误,如果你没有为你发送请求的Content-Type适当 MediaTypeFormatter 。例如,如果您使用的是 JsonMediaTypeFormatter 您需要确保您发送

I don't think the route is the problem. You should be fine with that route if that's how you want to write it. You will get that error if you do not have an appropriate MediaTypeFormatter for the Content-Type you are sending in the request. For example, if you are using a JsonMediaTypeFormatter you need to make sure you are sending

Content-Type: application/json

在您的请求。它看起来并不像你。

in your request. Which it doesn't look like you are.