I\'m trying to use HttpURLClient to send some POST data to a server using the HttpRestClient
class shown below. When executing
conn.setDoInput(true)
It may be a misleading exception. See this defect for Jersey-2 https://java.net/jira/browse/JERSEY-2729
The link has been updated: https://github.com/jersey/jersey/issues/3001
Basically the issue is jersey was throwing invalid exception. The real issue in my case was that the connection was refused from the server.