title: Asp.net Core UseExceptionHandler not working POST request
body: <p>In my .Net Core 2.0 application i have implemented <strong>UseExceptionHandler</strong> to handle exceptions globally. But redirection only works for GET method and POST method always return <strong>Status Code: 404; Not Found</strong></p>
  
  <p>Here is my Startup.cs Configure method</p>
  
  <pre><code>public void Configure(IApplicationBuilder app, IHostingEnvironment env, 
  ILoggerFactory loggerFactory)
  {
          app.UseCors(builder =&gt; builder
                      .AllowAnyOrigin()
                      .AllowAnyMethod()
                      .AllowAnyHeader()
                      .AllowCredentials());
          loggerFactory.AddConsole(Configuration.GetSection("Logging"));
          loggerFactory.AddDebug();
  
          if (env.IsDevelopment())
          {
              app.UseStatusCodePages();
              app.UseDatabaseErrorPage();
              app.UseBrowserLink();
              app.UseDeveloperExceptionPage();
              app.UseExceptionHandler("/api/v1/Error");
          }
          else
          {
              app.UseExceptionHandler("/api/v1/Error");
          }
  
          app.UseMvc();
          app.UseSwagger();
  
          app.UseSwaggerUI(c =&gt;
          {
              c.RoutePrefix = "docs";
              c.SwaggerEndpoint("/swagger/v1/swagger.json", "V1 Docs");
              c.SwaggerEndpoint("/[]virtualDir]/swagger/v1/swagger.json", "V1 Docs");
          });
      }
  </code></pre>
  
  <p>And Error controller is</p>
  
  <pre><code>[Route("api/v1/[controller]")]
  public class ErrorController : Controller
  {
      private readonly IErrorLoggerService _errorLoggerService;
  
      public ErrorController(IErrorLoggerService errorLoggerService)
      {
          _errorLoggerService= errorLoggerService;
      }
      [HttpGet]
      public IActionResult Get()
      {
          // Get the details of the exception that occurred
          var exceptionFeature = HttpContext.Features.Get&lt;IExceptionHandlerPathFeature&gt;();
          var errorLog = new ErrorLog();
  
          if (exceptionFeature != null)
          {
              // Get which route the exception occurred at
              var routeWhereExceptionOccurred = exceptionFeature.Path;
  
              // Get the exception that occurred
              var exceptionThatOccurred = exceptionFeature.Error;
  
              // TODO: save exception in db
              errorLog = new ErrorLog
              {
                  Application = routeWhereExceptionOccurred,
                  Source = exceptionThatOccurred.Source,
                  CreatedDate = DateTime.Now,
                  Host = exceptionThatOccurred.InnerException?.ToString(),
                  Type = exceptionThatOccurred.Message,
                  Detail = exceptionThatOccurred.StackTrace
              };
              _errorLoggerService.Save(errorLog);
              return Json(errorLog);
          }
  
          return Json(errorLog);
      }
  }
  </code></pre>
  
  <p>How to fix it?</p>