@HttpEntity参数(怪异)

1)、在Controller中写

与@RequestBody请求体对应

@HttpEntity更强大,不光有请求体,还能获取请求头

@RequestMapping("/test02")
    public String test02(HttpEntity<String>  str){
        System.out.println(str);
        return "success";
    }

2)、在页面中写;

同样是form表单

<form action="${ctp }/test02" method="post"
        enctype="multipart/form-data">
        <input name="username" value="tomcat" /> <input name="password"
            value="123456"> <input type="file" name="file" /> <input
            type="submit" />
</form>

猜你喜欢

转载自www.cnblogs.com/yanl55555/p/11906929.html