epugh commented on code in PR #4266:
URL: https://github.com/apache/solr/pull/4266#discussion_r3043385937
##########
solr/test-framework/src/java/org/apache/solr/util/RestTestHarness.java:
##########
@@ -179,31 +161,40 @@ public void reload() throws Exception {
@Override
public String update(String xml) {
try {
- HttpPost httpPost = new HttpPost(getBaseURL() + "/update");
- httpPost.setEntity(
- new StringEntity(xml, ContentType.create("application/xml",
StandardCharsets.UTF_8)));
- return getResponse(httpPost);
+ return getResponse(
+ getHttpClient()
+ .newRequest(URLUtil.buildURI(getBaseURI(), "/update"))
+ .method("POST")
+ .body(new StringRequestContent("application/xml", xml,
StandardCharsets.UTF_8)));
+ } catch (RuntimeException e) {
+ throw e;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/** Executes the given request and returns the response. */
- private String getResponse(HttpUriRequest request) throws IOException {
- HttpEntity entity = null;
+ private String getResponse(Request request) throws IOException {
try {
- entity =
- httpClient
- .execute(request,
HttpClientUtil.createNewHttpClientRequestContext())
- .getEntity();
- return EntityUtils.toString(entity, StandardCharsets.UTF_8);
- } finally {
- EntityUtils.consumeQuietly(entity);
+ ContentResponse rsp = request.send();
+ // if (rsp.getStatus() >= 300 && rsp.getStatus()!=) {
Review Comment:
Do make some follow on JIRA for things to improve post this landing
sonitbisnt all in your head ;-). And share the workload!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]