Recommended solutions based on your search
Check if you didn't set RequestProperty Content-Type to the wrong type or if you're trying to send the wrong file to the server.
Solutions on the web
java.io.IOException: Server returned HTTP response code: 401 for URL: http://localhost:4848/management/domain
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)