HttpServletRequest获取header参数 sign

HttpServletRequest获取header参数 sign

//从请求头中获取参数
    private static Map<String, String> getHeaders(HttpServletRequest request) {
        Map<String, String> headerMap = new HashMap<>();
        Enumeration<String> enumeration = request.getHeaderNames();
        while (enumeration.hasMoreElements()) {
            String name    = enumeration.nextElement();
            String value = request.getHeader(name);
            headerMap.put(name, value);
        }
        return headerMap;
    }

    //获取请求头中的签名
String signStr = headers.get("byte-signature");

 

posted on 2024-06-08 06:48  oktokeep  阅读(142)  评论(0编辑  收藏  举报