-
ABP Framework version: v6.0.3
-
UI type: Blazor
-
DB provider: EF Core
-
Tiered (MVC) or Identity Server Separated (Angular): no
When sending X-Requested-With :XMLHttpRequest
in the header, the correct status is responded when unauthorized: 401 instead of 200.
But the content is still the HTML page:
...
...
How can I get a the default error JSON response content?
{
"error": {
"message": "Some error message"
}
}
I tried to send additional headers:
Content-Type: application/json
Accept: application/json
But the content is always HTML.
Thank you for your help!
3 Answer(s)
-
0
Hello BassaSolutions,
could you please provide steps to reproduce.
Regards,
-
0
-
Load startup template
-
Call any authorized endpoint with postman (without authorization). Add header: X-Requested-With :XMLHttpRequest
-
Response content is HTML (target: JSON)
-
-
0
Hello BassaSolutions,
Please check this similar issue https://support.abp.io/QA/Questions/3281/Swagger-Authorisation--401-Response-instead-of-login-page-redirect#
Regards,