(String uriSuffix, boolean withAuth)
| 110 | } |
| 111 | |
| 112 | protected String doGet(String uriSuffix, boolean withAuth) throws IOException { |
| 113 | HttpGet request = new HttpGet(baseUrl + uriSuffix); |
| 114 | HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); |
| 115 | if (withAuth) { |
| 116 | httpClientBuilder = httpClientBuilder.setDefaultCredentialsProvider(getCredentials()); |
| 117 | } |
| 118 | try (CloseableHttpClient httpClient = httpClientBuilder.build(); |
| 119 | CloseableHttpResponse response = httpClient.execute(request)) { |
| 120 | HttpEntity entity = response.getEntity(); |
| 121 | return entity != null ? EntityUtils.toString(entity) : ""; |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | public String doPost(String uriSuffix, boolean withAuth, List<NameValuePair> params) throws IOException { |
| 126 | final HttpPost httpPost = new HttpPost(baseUrl + uriSuffix); |
no test coverage detected