Skip to content

Instantly share code, notes, and snippets.

@manoj-choudhari-git
Created June 9, 2021 22:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manoj-choudhari-git/da2e4763173f268381a636e0ce15faee to your computer and use it in GitHub Desktop.
Save manoj-choudhari-git/da2e4763173f268381a636e0ce15faee to your computer and use it in GitHub Desktop.
.NET Core Web API - Respect Accept header from Browser
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers(options =>
{
// Always respect Accept Header from Browser
// Instead of default behavior
options.RespectBrowserAcceptHeader = true;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment