I have a requirement to create a RESTful Service using RESTEasy. Clients can call this shared service with any number of request parameters that they would like. My REST code should be able to read these Request Parameters in some way. For example, if I have a book search service, clients can make the following calls.
http:
http:
http:
http:
I need to write a service class as described below.
@Path("/books")
public class BookRestService{
@GET
@Path("/searchBook")
public Response searchBook(@QueryParam("bookName") String bookName,@QueryParam("isbn") String isbn) {
}
@POST
@Path("/addBook")
public Response addBook(......) {
}
}
Sorry for the poor format (I could not understand how code formatting works in this editor!). As you can see, I need to change the searchBook () method to execute any number of query parameters.
I saw a similar post here, but could not find the right solution.
URL- RESTful ?
- , ?