summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-impl/rest
diff options
context:
space:
mode:
Diffstat (limited to 'models-interactions/model-impl/rest')
-rw-r--r--models-interactions/model-impl/rest/src/main/java/org/onap/policy/rest/RestManager.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/models-interactions/model-impl/rest/src/main/java/org/onap/policy/rest/RestManager.java b/models-interactions/model-impl/rest/src/main/java/org/onap/policy/rest/RestManager.java
index 2ee47a9fc..643c629b3 100644
--- a/models-interactions/model-impl/rest/src/main/java/org/onap/policy/rest/RestManager.java
+++ b/models-interactions/model-impl/rest/src/main/java/org/onap/policy/rest/RestManager.java
@@ -41,9 +41,11 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class RestManager {
-
private static final Logger logger = LoggerFactory.getLogger(RestManager.class);
+ // Constants for string literals
+ private static final String CONTENT_TYPE = "Content-Type";
+
public class Pair<A, B> {
public final A first;
public final B second;
@@ -69,7 +71,7 @@ public class RestManager {
Map<String, String> headers, String contentType, String body) {
HttpPut put = new HttpPut(url);
addHeaders(put, username, password, headers);
- put.addHeader("Content-Type", contentType);
+ put.addHeader(CONTENT_TYPE, contentType);
try {
StringEntity input = new StringEntity(body);
input.setContentType(contentType);
@@ -96,7 +98,7 @@ public class RestManager {
Map<String, String> headers, String contentType, String body) {
HttpPost post = new HttpPost(url);
addHeaders(post, username, password, headers);
- post.addHeader("Content-Type", contentType);
+ post.addHeader(CONTENT_TYPE, contentType);
try {
StringEntity input = new StringEntity(body);
input.setContentType(contentType);
@@ -141,7 +143,7 @@ public class RestManager {
HttpDeleteWithBody delete = new HttpDeleteWithBody(url);
addHeaders(delete, username, password, headers);
if (body != null && !body.isEmpty()) {
- delete.addHeader("Content-Type", contentType);
+ delete.addHeader(CONTENT_TYPE, contentType);
try {
StringEntity input = new StringEntity(body);
input.setContentType(contentType);