Created
June 9, 2021 22:11
-
-
Save manoj-choudhari-git/da2e4763173f268381a636e0ce15faee to your computer and use it in GitHub Desktop.
.NET Core Web API - Respect Accept header from Browser
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
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