java - how to send JSON data with server error response code 500 -


I wanted to know whether there is a way to send JSON data with HTTP response code 500. In fact, I want my rest client to know that there is some error on the backend and simultaneously send a JSON error data structure like this. {"Code": "1001", "desc": "some error description"}, {"code": "1002", "desc": " Some other error descriptions "}]}

This is the following zaby stack = Java6 / Jx-RS / jersey / tomcat

if not, then custom with JSON data One way to send feedback codes is to basically look for the JX-RS API, that you can send JSON data with 200 OK ??

Any ideas ?? I'm guessing that the rest will be the same, right ??

You just need to set HTTP header response


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -