import javax.servlet.http.HttpServletRequest;
import java.util.Collections;
import java.util.HashMap
import java.util.Map;
import java.util.stream.Collectors;
public class Utils {
public static Map<String, String> getHeaderMap(HttpServletRequest request) {
return new HashMap<String, String>() {{
Collections.list(request.getHeaderNames())
.stream()
.forEach(key -> {
put(key, request.getHeader(key));
});
}};
}
}
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme