我有这个(简化的)ASP.NET Core Web API控制器.GET和POST操作都可以在我自己的机器上很好地工作.但是,部署到Azure只有GET操作才能正常工作.POST动作导致404.任何想法?
namespace Foo
{
using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc;
[RequireHttps]
[Produces("application/json")]
[Area("Foo")]
[Route("[area]/Api/[controller]")]
public class BarController : Controller
{
[HttpGet]
public IEnumerable<string> Get()
{
return new[] {"Hello", "World!"};
}
[HttpPost]
public void Post([FromBody] InputModel model)
{
}
public class InputModel
{
public int Foo { get; set; }
}
}
}
Run Code Online (Sandbox Code Playgroud)
它是一个针对完整.NET框架的ASP.NET Core MVC应用程序.它部署为Azure Web App.我已使用Postman在本地计算机和Azure中测试了这两个操作.