public String printResponseHeaders ( ) { StringBuilder sb = new StringBuilder ( ) ; HttpURLConnection http = http ( ) ; if ( http != null ) { Map < String , List < String > > header = http . getHeaderFields ( ) ; for ( String key : header . keySet ( ) ) { for ( String val : header . get ( key ) ) { sb . append ( key ) . append ( ": " ) . append ( val ) . append ( "\n" ) ; } } } return sb . toString ( ) ; }
Print out the response headers for this resource .