Skip to content

Instantly share code, notes, and snippets.

@rterp
Created February 4, 2016 01:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rterp/a5461f8df7aa41419580 to your computer and use it in GitHub Desktop.
Save rterp/a5461f8df7aa41419580 to your computer and use it in GitHub Desktop.
protected static ResteasyClient getClient() {
CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
UsernamePasswordCredentials credentials = new UsernamePasswordCredentials("adminUser", "adminPassword");
credentialsProvider.setCredentials(AuthScope.ANY, credentials);
HttpClient httpclient = HttpClientBuilder.create().setDefaultCredentialsProvider(credentialsProvider).build();
ApacheHttpClient4Engine engine = new ApacheHttpClient4Engine(httpclient, true);
return new ResteasyClientBuilder().httpEngine(engine).build();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment