标签:hone request public form comm 解析 ring object pre
@RequestBody是用来接收
application/json
需要解析json字符串,然后通过json获取参数,这里用到是fastjson
public CommonReturnType login(@RequestBody String jsonStr) { JSONObject requestJson = JSON.parseObject(jsonStr); String telphone=(String)requestJson.get("telphone"); String password=(String)requestJson.get("password"); }
@RequestParam是用来接收
application/x-www-form-urlencoded
可直接获取参数
public CommonReturnType login(
@RequestParam(name="telphone") String telphone,
@RequestParam(name="password") String password) { System.out.println(telphone+password) }
标签:hone request public form comm 解析 ring object pre
原文地址:https://www.cnblogs.com/llcMite/p/11392790.html