java如何取得http自定義的頭部信息?
void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { Enumeration enum1 = req.getHeaderNames(); log.debug("-----------header----------------->"); while(enum1.hasMoreElements()){ String key = (String)enum1.nextElement(); String value = req.getHeader(key); log.debug(key + ":" + value); } log.debug("<-----------header-----------------"); }這樣就可以拿到頭部的信息
下一篇c語言的變量定義