When using app.UseHttpsRedirection(); in startup.cs and https link,
The Response doesn't contain status code description
Error status code when using https image
but when app.UseHttpsRedirection(); is removed from startup.cs and using http link,
The Response contains status code along with description
Required response got using http image
How to configure https or .Net Core to send status code description ?
I'm using .NetCore 3.1
statup.cs
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseSwagger();
app.UseSwaggerUI(options =>
{
options.SwaggerEndpoint("/swagger/v1/swagger.json", "BAIM");
});
app.UseHttpsRedirection();
app.UseRouting();
app.UseAuthentication();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
}
and controller method
[HttpGet]
public ActionResult<IEnumerable<WeatherForecast>> Get()
{
return BadRequest();
}
Need the response with error code and description thanks a lot in Advance