是否有可能從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