标签:ack adr form values str range ring mes code
1.打印头信息
@RequestMapping(value = "/upload", method = RequestMethod.POST) @ResponseBody public List<UploadResult> upload(@RequestParam(name = "files", required = true) MultipartFile[] multipartFiles, @RequestHeader HttpHeaders httpHeaders, @RequestHeader(name = "content-range", required = false) String contentRange, @RequestHeader(name = "content-disposition", required = false) String contentDisposition, @RequestHeader(name = "Block-Index", required = false) Integer blockIndex, @RequestHeader(name = "Block-Total", required = false) Integer blockTotal, @RequestHeader(name = "Block-Done", required = false) String blockDone )
System.out.println("-----------------------------------------------------------"); Iterator<String> headerNames = httpHeaders.keySet().iterator(); while (headerNames.hasNext()) { String key = headerNames.next(); List<String> valueList = httpHeaders.getValuesAsList(key); String valueStr = ""; for (String value : valueList) { valueStr += "|" + value; } System.out.println(key + " --> " + valueStr); }
System.out.println("-----------------------------------------------------------"); Enumeration<String> headerNames = request.getHeaderNames(); while (headerNames.hasMoreElements()) { String key = headerNames.nextElement(); String value = request.getHeader(key); System.out.println(key + " --> " + value); }
2.打印form参数
Map<String, String[]> parameterMap = request.getParameterMap(); Iterator<Entry<String, String[]>> iterator = parameterMap.entrySet().iterator(); System.out.println("--form--------------------------"); while (iterator.hasNext()) { Entry<String, String[]> keyValues = iterator.next(); String key = keyValues.getKey(); String[] values = keyValues.getValue(); System.out.println("--form--------------------------" + key + " --> "); }
标签:ack adr form values str range ring mes code
原文地址:https://www.cnblogs.com/gispathfinder/p/10203523.html