aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/att/nsa/mr/client/impl/DmaapClientUtil.java6
-rw-r--r--src/main/java/com/att/nsa/mr/client/impl/MRBaseClient.java4
2 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/com/att/nsa/mr/client/impl/DmaapClientUtil.java b/src/main/java/com/att/nsa/mr/client/impl/DmaapClientUtil.java
index 17a37d9..a3a2ce1 100644
--- a/src/main/java/com/att/nsa/mr/client/impl/DmaapClientUtil.java
+++ b/src/main/java/com/att/nsa/mr/client/impl/DmaapClientUtil.java
@@ -64,6 +64,12 @@ public class DmaapClientUtil {
return target.request().header("Authorization", "Basic " + authHeader).get();
}
+
+ public static Response postResponsewtBasicAuth(WebTarget target, String authHeader,byte[] data,String contentType) {
+
+ return target.request().header("Authorization", "Basic " + authHeader).post(Entity.entity(data, contentType));
+
+ }
public static Response getResponsewtNoAuth(WebTarget target) {
diff --git a/src/main/java/com/att/nsa/mr/client/impl/MRBaseClient.java b/src/main/java/com/att/nsa/mr/client/impl/MRBaseClient.java
index c3d1c26..a0c514c 100644
--- a/src/main/java/com/att/nsa/mr/client/impl/MRBaseClient.java
+++ b/src/main/java/com/att/nsa/mr/client/impl/MRBaseClient.java
@@ -101,7 +101,7 @@ public class MRBaseClient extends HttpClient implements MRClient {
target = DmaapClientUtil.getTarget(path, username, password);
String encoding = Base64.encodeAsString(username + ":" + password);
- response = DmaapClientUtil.getResponsewtBasicAuth(target, encoding);
+ response = DmaapClientUtil.postResponsewtBasicAuth(target, encoding,data, contentType);
return getResponseDataInJson(response);
} else {
@@ -134,7 +134,7 @@ public class MRBaseClient extends HttpClient implements MRClient {
target = DmaapClientUtil.getTarget(path, username, password);
String encoding = Base64.encodeAsString(username + ":" + password);
- response = DmaapClientUtil.getResponsewtBasicAuth(target, encoding);
+ response = DmaapClientUtil.postResponsewtBasicAuth(target, encoding,data, contentType);
responseData = (String)response.readEntity(String.class);
return responseData;