You can get the headers through the various getHeaderField(s) methods of HttpURLConnection and its superclass. I don't think you can get the entire dump of the return short of connecting directly with a socket, making a request and reading the response.
I've done it the socket route. It's a bit of a pain because you have to construct all headers for the request, too. Get an HTTP sniffer and watch what's going over the wire both ways to see what the headers look like. You may be able to catch a set from the sniffer and copy them right into your code to send them again later.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Roses are red, violets are blue. Some poems rhyme and some don't. And some poems are a tiny ad.