MCPcopy Create free account
hub / github.com/OpenAS2/OpenAs2App / doGet

Method doGet

Server/src/test/java/org/openas2/app/RestApiTest.java:112–123  ·  view source on GitHub ↗
(String uriSuffix, boolean withAuth)

Source from the content-addressed store, hash-verified

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);

Calls 3

getCredentialsMethod · 0.95
executeMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected