@OliverA I can now see the confusion with okHttpUtils2 (completely forgot about that one because I do not use it

). It is intended to be used with jServer (jetty) and there one has handlers where you can return the error codes yourself in the response after analysing the JSON. So like you say, the server side.
Maybe it would be a good idea that, next to the HTTP status code, I also return some JSON like:
{
"status": 400,
"message": "Invalid input"
}
Would this help? (as said, I don't know OkHttpUtils2).
I'm also thinking on third parties (who do not use B4X products), but still want to connect to a REST API created in B4X.