Skip to content

DeveloperExceptionPageMiddleware always returns HTML, sometimes JSON would be better #2590

Closed
@aspnet-hello

Description

@aspnet-hello

From @tjrobinson on Friday, February 3, 2017 3:54:20 AM

We're using the DeveloperExceptionPageMiddleware and it would be really useful if it could be changed/configured so that AJAX requests to APIs, e.g. from an Angular application were given a JSON response back instead of HTML. This would make the response much more readable when using F12 tools or testing the API through other non-browser tools like Postman.

I hope that's enough information to make sense, let me know if not.

There's a similar problem discussed here: http://stackoverflow.com/questions/35245893/mvc-6-webapi-returning-html-error-page-instead-of-json-version-of-exception-obje

Thanks!

Copied from original issue: aspnet/Diagnostics#346

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✔️ Resolution: Won't FixResolved because we decided not to change the behavior reported in this issue.area-middlewareIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesfeature-diagnosticsDiagnostic middleware and pages (except EF diagnostics)

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions