我正在尝试在localhost上使用jenkins api,但是jenkins服务器正在发送"来自服务器"的空回复。知道什么是错的吗?
curl http://localhost:8080/job/test/lastBuild/api/json?token=testing -v
* About to connect() to localhost port 8080 (#0)
* Trying 127.0.0.1...
* connected
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /job/test/lastBuild/api/json?token=testing HTTP/1.1
> User-Agent: curl/7.24.0 (x86_64-redhat-linux-gnu) libcurl/7.24.0 NSS/3.13.5.0 zlib/1.2.5 libidn/1.18 libssh2/1.2.2
> Host: localhost:8080
> Accept: */*
>
* Empty reply from server
* Connection #0 to host localhost left intact
curl: (52) Empty reply from server
* Closing connection #0
答案 0 :(得分:0)
我找到了原因,httpport被设置为“-1”,因为jenkins发送了一个空的回复。
之前 -
JENKINS_ARGS="--httpPort=-1"
之后 -
JENKINS_ARGS="--httpPort=65530"