diff options
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/main')
-rw-r--r-- | bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java | 6 | ||||
-rw-r--r-- | bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java index 07f448e5e1..7d2fc10d0b 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java @@ -55,7 +55,7 @@ public class SDNCClient { BaseClient<String, LinkedHashMap<String, Object>> STOClient = new BaseClient<>(); STOClient.setTargetUrl(targetUrl); - HttpHeaders httpHeader = sdnCommonTasks.getHttpHeaders(properties.getAuth()); + HttpHeaders httpHeader = sdnCommonTasks.getHttpHeaders(properties.getAuth(), true); STOClient.setHttpHeader(httpHeader); LinkedHashMap<String, Object> output = STOClient.post(jsonRequest, new ParameterizedTypeReference<LinkedHashMap<String, Object>>() {}); @@ -67,7 +67,7 @@ public class SDNCClient { String jsonRequest = sdnCommonTasks.buildJsonRequest(request); BaseClient<String, LinkedHashMap<String, Object>> STOClient = new BaseClient<>(); STOClient.setTargetUrl(url); - HttpHeaders httpHeader = sdnCommonTasks.getHttpHeaders(properties.getAuth()); + HttpHeaders httpHeader = sdnCommonTasks.getHttpHeaders(properties.getAuth(), true); STOClient.setHttpHeader(httpHeader); LinkedHashMap<String, Object> output = STOClient.post(jsonRequest, new ParameterizedTypeReference<LinkedHashMap<String, Object>>() {}); @@ -87,7 +87,7 @@ public class SDNCClient { String targetUrl = UriBuilder.fromUri(properties.getHost()).path(queryLink).build().toString(); BaseClient<String, LinkedHashMap<String, Object>> STOClient = new BaseClient<>(); STOClient.setTargetUrl(targetUrl); - HttpHeaders httpHeader = sdnCommonTasks.getHttpHeaders(properties.getAuth()); + HttpHeaders httpHeader = sdnCommonTasks.getHttpHeaders(properties.getAuth(), false); STOClient.setHttpHeader(httpHeader); LinkedHashMap<String, Object> output = STOClient.get(jsonRequest, new ParameterizedTypeReference<LinkedHashMap<String, Object>>() {}); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java index 1144648517..e7e4e25af2 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java @@ -82,10 +82,12 @@ public class SdnCommonTasks { * @param auth * @return */ - public HttpHeaders getHttpHeaders(String auth) { + public HttpHeaders getHttpHeaders(String auth, boolean includeContentType) { HttpHeaders httpHeader = new HttpHeaders(); httpHeader.set("Authorization", auth); - httpHeader.setContentType(MediaType.APPLICATION_JSON); + if (includeContentType) { + httpHeader.setContentType(MediaType.APPLICATION_JSON); + } List<MediaType> acceptMediaTypes = new ArrayList<>(); acceptMediaTypes.add(MediaType.APPLICATION_JSON); httpHeader.setAccept(acceptMediaTypes); |