HttpRequestInput

    public HelloDto hello(HttpServletRequest request) {
        if (request != null) {
            System.out.println(request.getContentType());
            
            try {
                ServletInputStream ris = request.getInputStream();                
                StringBuilder content = new StringBuilder();  
                byte[] b = new byte[1024];  
                int lens = -1;  
                while ((lens = ris.read(b)) > 0) {  
                    content.append(new String(b, 0, lens));  
                }
                
                System.out.println(content.toString());
            } catch (Exception e) {
                System.out.println(e.getMessage());
            }
        }
        
        return helloService.hello(new HelloVo());
    }
原文地址:https://www.cnblogs.com/BlueEye/p/6803636.html