Java HttpClient Basic Credential 認證

FrankYou發表於2017-07-03
HttpClient client = factory.getHttpClient(); //or any method to get a client instance
Credentials credentials = new UsernamePasswordCredentials(username, password);
client.getState().setCredentials(AuthScope.ANY, credentials);

 

相關文章