For the API method you are calling, to put it simply, No authentication is required. Aside from a header containing a Client ID.
You are calling
Which is a GET request not a POST like in your snippet.
This should do what you need:
url = new URL(("https://api.twitch.tv/kraken/streams?channel=" + channelName));
connection = (HttpURLConnection)url.openConnection();
connection.setRequestMethod("GET");
connection.setRequestProperty("Client-ID",
YOURCLIENTIDHERE);