diff options
author | Rob Daugherty <rd472p@att.com> | 2018-10-18 12:43:33 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-10-18 12:43:33 +0000 |
commit | 5f95907dfa4213d8ac23e221c194f930f568b970 (patch) | |
tree | dfed1668aeaff9402e2d2cbd663dd1e9a9e6abbd /bpmn/MSOCommonBPMN/src/main/java | |
parent | 19ca704576ea511935f7bb5d41e49886ce9a097c (diff) | |
parent | e761fa50f80b2d6888f510f67cab1d6e740fd28e (diff) |
Merge "Bug fixes October 16"
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/main/java')
-rw-r--r-- | bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/baseclient/BaseClient.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/baseclient/BaseClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/baseclient/BaseClient.java index 78f3e96978..af93c1bfc0 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/baseclient/BaseClient.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/baseclient/BaseClient.java @@ -20,11 +20,15 @@ package org.onap.so.bpmn.common.baseclient; +import java.util.ArrayList; +import java.util.List; + import org.onap.so.logging.jaxrs.filter.SpringClientFilter; import org.springframework.core.ParameterizedTypeReference; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.http.client.BufferingClientHttpRequestFactory; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; @@ -40,6 +44,17 @@ public class BaseClient<I,O> { public HttpHeaders getHttpHeader() { return httpHeader; } + + public HttpHeaders setDefaultHttpHeaders(String auth) { + httpHeader = new HttpHeaders(); + httpHeader.set("Authorization", auth); + httpHeader.setContentType(MediaType.APPLICATION_JSON); + List<MediaType> acceptMediaTypes = new ArrayList<MediaType>(); + acceptMediaTypes.add(MediaType.APPLICATION_JSON); + acceptMediaTypes.add(MediaType.TEXT_PLAIN); + httpHeader.setAccept(acceptMediaTypes); + return httpHeader; + } public void setHttpHeader(HttpHeaders httpHeader) { this.httpHeader = httpHeader; |