I using Resteasy to call my back
So I use a interface to configure my call
@Path("/api/private/configuracao")
public interface ConfiguracaoClient {
@GET
@Path("/")
@Consumes("application/json")
@HeaderParam(value = "db_teste")
public ConfiguracaoVO findConfiguracao();
}
and call like this:
public class ConfiguracaoClientImpl {
ResteasyClient client;
ConfiguracaoClient configuracaoClient;
public ConfiguracaoClientImpl() {
client = new ResteasyClientBuilder().build();
ResteasyWebTarget target = client.target("http://localhost:8181/");
target.request().header("public","db_teste");
configuracaoClient = target.proxy(ConfiguracaoClient.class);
}
public ConfiguracaoVO findConfiguracao(){
return configuracaoClient.findConfiguracao();
}
}
how can I add a parameter in header? tks