mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-12-16 06:41:29 +01:00
Fixed bug that occurs when calling the HTTP controller's post operation
Change-Id: If356c8a8951ee98d709ab34fff984a58c4119ef8
This commit is contained in:
parent
926bae6af0
commit
186b9580e8
@ -160,13 +160,14 @@ public class HttpSBControllerImpl implements HttpSBController {
|
|||||||
Response response = null;
|
Response response = null;
|
||||||
if (payload != null) {
|
if (payload != null) {
|
||||||
try {
|
try {
|
||||||
response = wt.request(mediaType.getType())
|
response = wt.request(mediaType).post(
|
||||||
.post(Entity.entity(IOUtils.toString(payload, StandardCharsets.UTF_8), mediaType.getType()));
|
Entity.entity(IOUtils.toString(payload, StandardCharsets.UTF_8), mediaType)
|
||||||
|
);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
log.error("Cannot do POST {} request on device {} because can't read payload", request, device);
|
log.error("Cannot do POST {} request on device {} because can't read payload", request, device);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
response = wt.request(mediaType.getType()).post(Entity.entity(null, mediaType.getType()));
|
response = wt.request(mediaType).post(Entity.entity(null, mediaType));
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user