controller 接口写法
import org.apache.commons.io.IOUtils; import javax.servlet.ServletInputStream;
@RequestMapping("/sendMsg.mob") @ResponseBody public String sendMsg(HttpServletRequest request) { ServletInputStream inputStream = null; String param = ""; try { // 获取请求输入流 inputStream = request.getInputStream(); //将请求信息转换为字符串 param = IOUtils.toString(inputStream, "UTF-8"); } catch (IOException e2) { e2.printStackTrace(); }
return ""; }