public static String getHeaders ( final HttpServletRequest req ) { Enumeration en = req . getHeaderNames ( ) ; StringBuffer sb = new StringBuffer ( ) ; while ( en . hasMoreElements ( ) ) { String name = ( String ) en . nextElement ( ) ; sb . append ( name ) ; sb . append ( ": " ) ; sb . append ( req . getHeader ( name ) ) ; sb . append ( "\n" ) ; } return sb . toString ( ) ; }
Return a concatenated string of all the headers