1. Domino REST
  2. Rest clients
  3. Header parameters

Header parameters

With Domino-rest we can set request headers by annotating the method arguments with @HeaderParam and this will automatically set a header in the request when we make the call. for example having the following service :

			@RequestFactory
public interface MoviesService {

    @Path("library/movies/{name}")
    @GET
    Movie getMovieByName(@PathParam("name") String movieName, @HeaderParam("token") String requestToken);
}
		

Then making a request call like this :

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

Then the request will be made to the following endpoint with the provided path param:

http://localhost:8080/service/library/movies/hulk

And if we check the request we also see that it has the header token: some token

We are a group of passionate people who love what we do

Donate & Support Us