Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
linenumberstrue
import com.sun.jersey.api.client.*;
import sun.misc.BASE64Encoder;

public class BaseClientMain {
    public static void main(String[] args) throws Exception {
        try {
            Client client = Client.create();
            WebResource webResource = client.resource("http://localhost:8080/rest/api/2/issue/QA-31");
            ClientResponse response = webResource.accept("application/json")
                    .header("Authorization", "Basic YWRtaW4lM0FhZG1pbg==")
                    .get(ClientResponse.class);
            String msgback = response.getEntity(String.class);
            System.out.println(msgback);
            response.close();
        } catch (UniformInterfaceException e) {
            e.printStackTrace();
        } catch (ClientHandlerException e) {
            e.printStackTrace();
        }
    }
}

...