Commit 0411d035 authored by afei's avatar afei
Browse files

从请求中获取参数并以+=拼接的方式,使用更为优雅的流式拼接

parent aa16ada8
......@@ -31,6 +31,7 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Iterator;
import java.util.Map;
import java.util.stream.Collectors;
/*
* 基于spring的 req 工具类
......@@ -83,11 +84,7 @@ public class RequestKitBean {
String body = "";
try {
String str;
while((str = request.getReader().readLine()) != null){
body += str;
}
body=request.getReader().lines().collect(Collectors.joining(""));
if(StringUtils.isEmpty(body)) {
return returnObject;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment