0
我使用RestEasy的打電話給我回添加標題PARAM與
所以我用一個界面來配置我的電話
@Path("/api/private/configuracao")
public interface ConfiguracaoClient {
@GET
@Path("/")
@Consumes("application/json")
@HeaderParam(value = "db_teste")
public ConfiguracaoVO findConfiguracao();
}
,並呼籲像這樣RestEasy的客戶:
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();
}
}
怎麼能我在頭中添加一個參數? tks