【发布时间】:2018-06-17 15:01:52
【问题描述】:
我只需要知道当有人使用参数调用我的 API 时如何操作 url 参数。
http://localhost:8100/apis/employee?firstName=john&lastName=Do
我想在我的 GET 方法中使用这些 firstName 和 lastName 参数,但我不知道如何提取它们。
@GET
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Response getEmployee() {
//Just need to extract the parameters in here so I can use on the logic to return only the ones that meet the requirements.
}
任何帮助将不胜感激。我在 Java 上使用 SpringBootApplication
【问题讨论】:
-
你使用什么语言?
-
我在 Java 上使用 SpringBootApplication
-
对Java不太了解,也许this older answer能帮到你
标签: rest api spring-mvc restful-url