I have this (simplified) ASP.NET Core Web API controller. Both GET and POST actions work fine on my machine. However, deployed to Azure, only the GET action works correctly. POST action leads to 404. Any ideas?
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; }
}
}
}
This is an ASP.NET Core MVC application aimed at the full .NET platform. It is being deployed as the Azure Web App. I tested both actions on my local machine and in Azure using Postman .
source
share