Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
And **FastAPI**'s `HTTPException` error class inherits from Starlette's `HTTPException` error class.
-The only difference, is that **FastAPI**'s `HTTPException` allows you to add headers to be included in the response.
-
-This is needed/used internally for OAuth 2.0 and some security utilities.
+The only difference is that **FastAPI**'s `HTTPException` accepts any JSON-able data for the `detail` field, while Starlette's `HTTPException` only accepts strings for it.
So, you can keep raising **FastAPI**'s `HTTPException` as normally in your code.