0 Replies Latest reply on Aug 22, 2009 8:18 PM by Elangovan Shanmugam

    How to add http headers to ResteasyProviderFactory

    Elangovan Shanmugam Newbie

      Hi all, I new to this forum... so dont know if this is right place to post this question... However...

      I have a problem but cant fine the solution, so I thought I would ask you.

      I am using ResteasyProviderFactory, ProxyFactory and ClientResponse to send & receive my request to the server from my test code like as follows.

      ResteasyProviderFactory instance = ResteasyProviderFactory.getInstance();
      RegisterBuiltin.register(instance);
      client = ProxyFactory.create(ISomeInterface.class, "http://localhost:8080/myresource/");
      ClientResponse<ResponseContent> resp = (ClientResponse< ResponseContent >) client.getResponse("param");
      String authHeader = resp.getHeaders().get("Authorization");
      


      OK. I am getting the authorization header from the server and I am able to read this. How will send the auth header to my subsequent request to the server.

      Am I using the Client framework correctly?
      Is there a way to add the header to my next request?

      Please help. Greatly appreciate your help.

      Thanks in advance.