首页 > 代码库 > Java HttpClient Basic Credential 认证

Java HttpClient Basic Credential 认证

HttpClient client = factory.getHttpClient(); //or any method to get a client instance
Credentials credentials = new UsernamePasswordCredentials(username, password);
client.getState().setCredentials(AuthScope.ANY, credentials);

 

Java HttpClient Basic Credential 认证