public void Configure(IApplicationBuilder appBuilder, ILoggerFactory loggerFactory)
{
appBuilder.Run(async context =>
{
if (context.Request.Method != "POST")
{
context.Response.ContentLength = 0;
context.Response.ContentType = "text/plain";
context.Response.StatusCode = (int)HttpStatusCode.MethodNotAllowed;
await context.Response.WriteAsync(string.Empty);
}
else
{
Listener.SendAsync(context);
}
});
}
}