我正在尝试在本地主机上使用 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
最佳答案
我找到了原因,httpport 设置为“-1”,因为 jenkins 发送了一个空回复。
之前 -
JENKINS_ARGS="--httpPort=-1"
之后 -
JENKINS_ARGS="--httpPort=65530"
关于linux - Jenkins API 不工作 - "Empty reply from server",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24645357/