Unverified Commit 60478ac9 authored by terrfly's avatar terrfly Committed by Gitee
Browse files

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

Merge pull request !13 from 奔跑阿飞/dev
parents aa16ada8 0411d035
...@@ -31,6 +31,7 @@ import java.io.IOException; ...@@ -31,6 +31,7 @@ import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/* /*
* 基于spring的 req 工具类 * 基于spring的 req 工具类
...@@ -83,11 +84,7 @@ public class RequestKitBean { ...@@ -83,11 +84,7 @@ public class RequestKitBean {
String body = ""; String body = "";
try { try {
String str; body=request.getReader().lines().collect(Collectors.joining(""));
while((str = request.getReader().readLine()) != null){
body += str;
}
if(StringUtils.isEmpty(body)) { if(StringUtils.isEmpty(body)) {
return returnObject; 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