I\'ve been working on a portlet that calls Rest API. When the API is called and the requested data doesn\'t exist, it returns an appropriate error message in JSON format (wi
In case of non-successful response codes, you have to read the body with HttpURLConnection.getErrorStream().