diff options
author | 2019-01-08 16:13:41 +0000 | |
---|---|---|
committer | 2019-01-08 16:13:41 +0000 | |
commit | 5f14d3ed20cc25df8a7c37cebaa74dc656168124 (patch) | |
tree | 32ea57e25bb71b411ed1769ba9ac116a9f91dcd6 /plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main | |
parent | a859f49ed0fd0c0e14f0035b28da2d22cc4d6c18 (diff) | |
parent | b60f265ae3fc2246a77a9f66836f6d45dfc5dfd2 (diff) |
Merge "Add example policy for HTTPS" into casablanca
Diffstat (limited to 'plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main')
2 files changed, 5 insertions, 3 deletions
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientConsumer.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientConsumer.java index 04397d688..5591777eb 100644 --- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientConsumer.java +++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientConsumer.java @@ -202,7 +202,7 @@ public class ApexRestClientConsumer implements ApexEventConsumer, Runnable { public void run() { try { final Response response = client.target(restConsumerProperties.getUrl()).request("application/json") - .get(); + .headers(restConsumerProperties.getHttpHeadersAsMultivaluedMap()).get(); // Check that the event request worked if (response.getStatus() != Response.Status.OK.getStatusCode()) { diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientProducer.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientProducer.java index a7e0ddd52..4113cea4b 100644 --- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientProducer.java +++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientProducer.java @@ -183,9 +183,11 @@ public class ApexRestClientProducer implements ApexEventProducer { private Response sendEventAsRestRequest(final String event) { // We have already checked that it is a PUT or POST request if (RestClientCarrierTechnologyParameters.HttpMethod.POST.equals(restProducerProperties.getHttpMethod())) { - return client.target(restProducerProperties.getUrl()).request("application/json").post(Entity.json(event)); + return client.target(restProducerProperties.getUrl()).request("application/json") + .headers(restProducerProperties.getHttpHeadersAsMultivaluedMap()).post(Entity.json(event)); } else { - return client.target(restProducerProperties.getUrl()).request("application/json").put(Entity.json(event)); + return client.target(restProducerProperties.getUrl()).request("application/json") + .headers(restProducerProperties.getHttpHeadersAsMultivaluedMap()).put(Entity.json(event)); } } |