Fixed bug that occurs when calling the HTTP controller's post operation

Change-Id: If356c8a8951ee98d709ab34fff984a58c4119ef8
This commit is contained in:
Georgios Katsikas 2017-05-31 17:25:54 +02:00
parent 926bae6af0
commit 186b9580e8

View File

@ -160,13 +160,14 @@ public class HttpSBControllerImpl implements HttpSBController {
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;
}