@PostMapping("/test/post") public void post(@RequestBody String params, @RequestHeader(required = false, value = "contentType") String contentType, @RequestHeader(required = false, value = "Accept") String Accept) { System.out.println("contentType:" + contentType); System.out.println("Accept:" + Accept); JSONObject json = JSONObject.parseObject(params); String userName = json.getString("username"); System.out.println("userName:" + userName); }
原文地址:https://www.cnblogs.com/huanggy/p/9637771.html
时间: 2024-10-08 18:07:45