Java 接收无参数post



 @RequestMapping(value = "/get_version2", method = RequestMethod.POST)
    public void testJson(@RequestBody String code,HttpServletResponse response, HttpServletRequest request) {
        response.setContentType("textml;charset=utf-8");
        PrintWriter writer;
        try {
            writer = response.getWriter();
            writer.println(code);
            writer.flush();
            writer.close();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    } 

你可能感兴趣的:(Java 接收无参数post)