Fixed bug that occurs when calling the HTTP controller's post operation
Change-Id: If356c8a8951ee98d709ab34fff984a58c4119ef8
diff --git a/protocols/rest/api/src/main/java/org/onosproject/protocol/http/ctl/HttpSBControllerImpl.java b/protocols/rest/api/src/main/java/org/onosproject/protocol/http/ctl/HttpSBControllerImpl.java
index e9990c3..550e346 100644
--- a/protocols/rest/api/src/main/java/org/onosproject/protocol/http/ctl/HttpSBControllerImpl.java
+++ b/protocols/rest/api/src/main/java/org/onosproject/protocol/http/ctl/HttpSBControllerImpl.java
@@ -160,13 +160,14 @@
Response response = null;
if (payload != null) {
try {
- response = wt.request(mediaType.getType())
- .post(Entity.entity(IOUtils.toString(payload, StandardCharsets.UTF_8), mediaType.getType()));
+ response = wt.request(mediaType).post(
+ Entity.entity(IOUtils.toString(payload, StandardCharsets.UTF_8), mediaType)
+ );
} catch (IOException e) {
log.error("Cannot do POST {} request on device {} because can't read payload", request, device);
}
} else {
- response = wt.request(mediaType.getType()).post(Entity.entity(null, mediaType.getType()));
+ response = wt.request(mediaType).post(Entity.entity(null, mediaType));
}
return response;
}