// we don't want to populate default http headers ...
connection.setPopulateDefaultHeaderItems(false);
// get at headers object
NIOHttpHeaders headers = connection.getRequestHeaders();
// populate http request string
headers.prepend("GET" + " " + theURL.getFile() +" " + "HTTP/1.1", null);
// populate host entry ...
if (theURL.getPort() != -1 && theURL.getPort() != 80) {
headers.set("Host",theURL.getHost() +":"+String.valueOf(theURL.getPort()));
}
else {