[Problem Details](https://www.rfc-editor.org/rfc/rfc7807.html) are not the only response format to describe an HTTP API error, however, they are commonly used to report errors for HTTP APIs. The problem details service implements the interface, which supports creating problem details in ASP.NET Core. The [`AddProblemDetails`](/dotnet/api/microsoft.extensions.dependencyinjection.problemdetailsservicecollectionextensions.addproblemdetails?view=aspnetcore-7.0&preserve-view=true) extension method on registers the default `IProblemDetailsService` implementation. In ASP.NET Core apps, the following middleware generates problem details HTTP responses when [`AddProblemDetails`](/dotnet/api/microsoft.extensions.dependencyinjection.problemdetailsservicecollectionextensions.addproblemdetails?view=aspnetcore-7.0&preserve-view=true) is called, except when the [`Accept` request HTTP header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept) doesn't include one of the content types supported by the registered (default: `application/json`): * : Generates a problem details response when a custom handler is not defined. * : Generates a problem details response by default. * : Generates a problem details response in development when the `Accept` request HTTP header does not include `text/html`.