Commit 7a45ef0c authored by 黎博's avatar 黎博

debug-修改获取HttpServletRequest Body的方法

parent d4265084
......@@ -39,38 +39,14 @@ public class PayInterceptor implements HandlerInterceptor {
* @return
* @throws IOException
*/
private String getRequestBody(HttpServletRequest request) {
BufferedReader br = null;
StringBuilder sb = new StringBuilder("");
try
{
br = request.getReader();
String str;
while ((str = br.readLine()) != null)
{
sb.append(str);
}
br.close();
}
catch (IOException e)
{
e.printStackTrace();
}
finally
{
if (null != br)
{
try
{
br.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
return sb.toString();
private String getRequestBody(HttpServletRequest request) throws IOException {
BufferedReader br = request.getReader();
String str = "";
String listString = "";
while ((str = br.readLine()) != null) {
listString += str;
}
return listString;
}
@Override
......
Markdown is supported
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