@ Nonnull @ ReturnsMutableCopy public static HttpHeaderMap getRequestHeaderMap ( @ Nonnull final HttpServletRequest aHttpRequest ) { ValueEnforcer . notNull ( aHttpRequest , "HttpRequest" ) ; final HttpHeaderMap ret = new HttpHeaderMap ( ) ; final Enumeration < String > aHeaders = aHttpRequest . getHeaderNames ( ) ; while ( aHeaders . hasMoreElements ( ) ) { final String sName = aHeaders . nextElement ( ) ; final Enumeration < String > eHeaderValues = aHttpRequest . getHeaders ( sName ) ; while ( eHeaderValues . hasMoreElements ( ) ) { final String sValue = eHeaderValues . nextElement ( ) ; ret . addHeader ( sName , sValue ) ; } } return ret ; }
Get a complete request header map as a copy .