protected Request buildMultipartRequest(String path,MultipartEntity multiPart) { HttpPost httpPost = new HttpPost(builder.buildUrl(path)); httpPost.setEntity(multiPart); /** * In case of Multipart requests, we must __NOT__ set the content-type header to multipart/form-data. * If we do it, we have a 400 response (bad request). */ return this.builder.buildOtherRequest(httpPost); }
boolean waiting = true; while(waiting){ Request req = builder.buildOtherRequest(new HttpGet(location)); req.withHeader("Accept", "application/json"); log.info("Ping method: {}", req.getRequest().getMethod());