【发布时间】:2017-03-08 11:32:16
【问题描述】:
我可以用 Python 做到这一点,但不能用 Curl...
$ curl -H "Content-Type: application/json; charset=UTF-8" --data-urlencode \
'{ "description": "This is a test job.", "displayName": "#30: Success" }' \
-n http://localhost/job/playground/30/configSubmit
<body><h2>HTTP ERROR 400</h2>
<p>Problem accessing /job/playground/30/configSubmit. Reason:
<pre> Nothing is submitted</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/>
【问题讨论】:
-
我在
curl -u <username>:<token> -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data-urlencode "description=hello world" https://jenkins.local/job/<job_name>/<build_id>/configSubmit、curl -u <username>:<token> -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data'{"description": "hello world"}' https://jenkins.local/job/<job_name>/<build_id>/configSubmit以及命令上的一大堆其他版本中遇到了同样的问题。
标签: curl jenkins jetty http-post jenkins-api