1.参考
Enumeration headerNames = req.getHeaderNames(); while(headerNames.hasMoreElements()) { String headerName = (String)headerNames.nextElement(); String headerValues = req.getHeader(headerName); System.out.println(headerName+" "+ headerValues); }