Skip to content

Instantly share code, notes, and snippets.

@nherbaut
Last active August 29, 2015 14:16
Show Gist options
  • Select an option

  • Save nherbaut/add5ea9699553cc8de95 to your computer and use it in GitHub Desktop.

Select an option

Save nherbaut/add5ea9699553cc8de95 to your computer and use it in GitHub Desktop.
basic auth jersey
public void testGetIt() throws IOException {
HttpAuthenticationFeature feature = HttpAuthenticationFeature.basic("user", "superSecretPassword");
Client client = ClientBuilder.newClient();
client.register(feature);
WebTarget target = client.target("http://localhost:8080/myapp");
target.path("myresource").get();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment