【发布时间】:2016-01-22 01:38:34
【问题描述】:
我在 Java Spring 应用程序中有以下 REST 控制器:
@RequestMapping(
value = "/api/getApplication/{me_userId}",
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
public Object getApplication(
@PathVariable String userId,
@RequestParam(value="fieldNames[]", required = false) String[] fieldNames) {
if (fieldNames != null) {
for (String fieldName : fieldNames)
System.out.println(fieldName);
}
...
return null;
}
所以我无法成功模拟来自 POSTMAN 的 DHC REST 的 API 调用,什么会通过该 fieldNames[]。
有人知道怎么做吗?
【问题讨论】:
-
有一个错字:@PathVariable 字符串应该是-me_userId
标签: spring-boot postman http-request-parameters