Skip to content

Query parameters

Ahmad K. Bawaneh edited this page Dec 28, 2019 · 2 revisions

Query parameters

if a service method argument is annotated with @QueryParam then will be automatically added to the request path as a query parameter.

Sample:

if we have the following service definition

@RequestFactory
public interface MoviesService {

    @Path("library/movies")
    @GET
    Movie getMovieByName(@QueryParam("name") String movieName);
}

then when we make the following request

MoviesServiceFactory.INSTANCE
    .getMovieByName("hulk")
    .onSuccess(movie ->{})
    .send();

then the request made to the server will have the following path

http://localhost:8080/service/library/movies?name=hulk