|
@@ -95,14 +95,13 @@ public class HkHttpUtils {
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public String doBodyPut(BodyRequestModel config) throws Exception {
|
|
|
- String entity = config.getEntity();
|
|
|
CredentialsProvider credsProvider = new BasicCredentialsProvider();
|
|
|
AuthScope favourite_digest_realm = new AuthScope(config.getIp(), config.getPort());
|
|
|
UsernamePasswordCredentials usernamePasswordCredentials = new UsernamePasswordCredentials(config.getUsername(), config.getPassword());
|
|
|
credsProvider.setCredentials(favourite_digest_realm, usernamePasswordCredentials);
|
|
|
CloseableHttpClient httpclient = HttpClients.custom().setDefaultCredentialsProvider(credsProvider).build();
|
|
|
HttpPut HttpPut = new HttpPut(config.getAgreement() + "://" + config.getIp() + ":" + config.getPort() + config.getUri());
|
|
|
- HttpPut.setEntity(new StringEntity(entity, "UTF-8"));
|
|
|
+ HttpPut.setEntity(new StringEntity(config.getEntity(), "UTF-8"));
|
|
|
CloseableHttpResponse responseBody = httpclient.execute(HttpPut);
|
|
|
HttpEntity responseEntity = responseBody.getEntity();
|
|
|
if (responseEntity != null) {
|