是否有可能从REST请求获取POST参数?是否可以从REST请求获取POST参数?
我尝试没有成功如下:
MultivaluedMap<String, String> params = uriInfo.getQueryParameters();
log.info("Params Size: "+params.size());
Iterator<String> it = params.keySet().iterator();
String theKey = null;
while(it.hasNext()){
theKey = it.next();
log.info("Here is a Key: "+theKey);
}
这里是我的方法签名:
@POST
@Produces("application/pdf")
@Path("/hello")
public Response producePDF(@FormParam("filename")String fileName, @Context UriInfo uriInfo)
日志显示为0 “PARAMS尺寸:”
我只能用一个得到?
什么是'uriInfo'? – 2014-09-03 15:50:47
@SotiriosDelimanolis泽西注射剂,提供有关被调用的URI的信息。 – 2014-09-03 15:52:05
它的'getPathParameters()'方法是做什么的? – 2014-09-03 15:52:41