獲取 request 中 json 資料
阿新 • • 發佈:2019-01-05
springMVC獲取請求中的json資料:都是post方式
方法一:
http://m.blog.csdn.net/article/details?id=50149061
方法二:
InputStream is = request.getInputStream();
StringBuffer req= new StringBuffer(2048);int i;byte[] buffer1 = new byte[2048];try{ i = is.read(buffer1);}catch(IOException e) { e.printStackTrace(); i = -1;}for(int String str = req.toString();
方法三:
InputStream is = request.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(is));String bb = br.readLine();
System.out.print("llllllllllllllllll: " + bb);