- WebTarget webTarget = client.target(url);
- webTarget.request(MediaType.APPLICATION_JSON)
- .put(Entity.entity(content, MediaType.APPLICATION_JSON));
+ HashMap<String, String> headers = new HashMap<>();
+ headers.put("Content-Type", MediaType.APPLICATION_JSON);
+ headers.put("Accept", MediaType.APPLICATION_JSON);
+ HttpResponse httpResponse;
+ try {
+ httpResponse = HttpsUtils
+ .put(url, headers, new HashMap<>(), new StringEntity(content));
+ } catch (UnsupportedEncodingException e) {
+ throw new CorrelationException("Failed to create https entity.", e);
+ } catch (Exception e) {
+ throw new CorrelationException(e.getMessage());
+ }
+ if (httpResponse != null) {
+ suc = httpResponse.getStatusLine().getStatusCode() == 200;
+ }
+ if (!suc) {
+ break;
+ }