Skip to content

Commit 6b1c5f7

Browse files
committed
Fix body request for jersey.
1 parent e8f82e8 commit 6b1c5f7

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/main/java/com/github/dockerjava/jaxrs/StartContainerCmdExec.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ public StartContainerCmdExec(WebTarget baseResource, DockerClientConfig dockerCl
2222

2323
@Override
2424
protected Void execute(StartContainerCmd command) {
25-
WebTarget webResource = getBaseResource().path("/containers/{id}/start").resolveTemplate("id",
26-
command.getContainerId());
25+
WebTarget webResource = getBaseResource().path("/containers/{id}/start")
26+
.resolveTemplate("id", command.getContainerId());
2727

2828
LOGGER.trace("POST: {}", webResource);
29-
webResource.request().accept(MediaType.APPLICATION_JSON).post(entity(command, MediaType.APPLICATION_JSON))
29+
webResource.request()
30+
.accept(MediaType.APPLICATION_JSON)
31+
.post(null)
3032
.close();
3133

3234
return null;

src/main/java/com/github/dockerjava/netty/exec/StartContainerCmdExec.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ protected Void execute(StartContainerCmd command) {
2323
command.getContainerId());
2424

2525
LOGGER.trace("POST: {}", webResource);
26-
webResource.request().accept(MediaType.APPLICATION_JSON).post(command);
26+
webResource.request()
27+
.accept(MediaType.APPLICATION_JSON)
28+
.post(command);
2729

2830
return null;
2931
}

0 commit comments

Comments
 (0)