0
考慮以下幾點:有什麼不對的路線
namespace Foo.Controllers
{
[RoutePrefix("api/route")]
public class SnoconesFooBarController : BaseApiController
{
/// <summary>
/// Asks for a new foo to be created to the given subnet with the specific bar named
/// </summary>
/// <param name="fooName"></param>
/// <param name="uriString"></param>
/// <returns></returns>
[Route("newFoo/{fooName}")]
public async Task<IHttpActionResult> PostNewFooForSpecificBar(string fooName, string uriString)
{
}
}
爲什麼我收到了404當我嘗試發佈到:
http://localhost:4471/api/route/newFoo/test1
具有以下有效載荷:
數據的這是什麼框架(API/MVC等)的路線.. – 2015-02-05 18:23:43
MVC,我改變了問題更精緻@ErikPhilips – 2015-02-05 18:26:43
它是否重要,你的變量名是'sourceName'而不是'fooName'? – 2015-02-05 18:32:56