Differences

This shows you the differences between two versions of the page.

Link to this comparison view

jersey_basic_auth [2014/02/26 10:03]
jersey_basic_auth [2021/04/05 11:23] (current)
Line 1: Line 1:
 +====== Jersey Client with Basic Auth ======
 +To add Basic Authentication to a web service call using the Jersey Client library a ''HTTPBasicAuthFilter'' instance need to be added to the ''WebResource''.
  
 +<sxh java>
 +WebResource service = Client.create().resource(url);
 +HTTPBasicAuthFilter filter = new HTTPBasicAuthFilter(username, password);
 +service.addFilter(filter);
 +</sxh>
 +
 +{{tag>devel java}}