【发布时间】:2018-08-08 19:34:58
【问题描述】:
我想查看使用 Spring Boot 构建的端点中的所有请求相关详细信息(如标头、正文)。如何得到它?
@RestController
public class SomeRestController {
...
@PostMapping("path/")
public String getResponse(@RequestBody SomeObject object) {
// There I want to look at Request details... but how?
...
}
...
}
【问题讨论】:
-
只需将
HttpServletRequest添加为参数,然后随心所欲地使用它。
标签: java spring spring-boot http-post