Servlet读取头信息

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
Enumeration<String> header=request.getHeaderNames();
while(header.hasMoreElements()){
String name=header.nextElement();
String value=request.getHeader(name);
System.out.println(name+":"+value);
}
}
posted @ 2015-10-09 20:59  preditctfuture  阅读(174)  评论(0编辑  收藏  举报