从请求中获取参数并以+=拼接的方式,使用更为优雅的流式拼接
This commit is contained in:
parent
aa16ada8ca
commit
0411d0354a
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue