Created
May 28, 2015 02:34
-
-
Save victorskl/1fc40dfcb0e707d1bd69 to your computer and use it in GitHub Desktop.
Print HttpServletRequest headers and their values
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
System.out.println(request.getMethod() + " : " + request.getRequestedSessionId()); | |
Enumeration headerNames = request.getHeaderNames(); | |
while (headerNames.hasMoreElements()) { | |
String headerName = (String) headerNames.nextElement(); | |
Enumeration headerValues = request.getHeaders(headerName); | |
while (headerValues.hasMoreElements()) { | |
String headerValue = (String) headerValues.nextElement(); | |
System.out.println("\t" + headerName + " : " + headerValue); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment