Oh apart from that I can't see anything else that's wrong, your code seems to match most examples I can see out there. Perhaps you could switch on/off some of the connection settings (such as setDoInput to false) to see if that makes a subtle difference.
Ah, I see you've solved it already, really interesting actually because I was looking at examples where people were complaining that they were getting an error page as part of their regular inputstream