This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Threading.Tasks; | |
using System.Web.Http; | |
using System.Xml.Serialization; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.Azure.WebJobs; | |
using Microsoft.Azure.WebJobs.Extensions.Http; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.Extensions.Logging; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNetCore.Mvc; | |
var builder = WebApplication.CreateBuilder(args); | |
// Add services to the container. | |
builder.Services.Configure<RouteHandlerOptions>(o => o.ThrowOnBadRequest = true); | |
var app = builder.Build(); | |
// middleware to check content-type header | |
app.Use(async (context, next) => |
OlderNewer