问题:2023-05-29 16:44:54.768754
jenkinsfile 像第三方发送请求 有多个参数,怎么写
答案: 可以使用Jenkins的HTTP Request插件来发送HTTP请求。在Jenkinsfile中,可以使用以下语法来发送HTTP请求:
httpRequest url: 'http://example.com/api', contentType: 'application/json', httpMode: 'POST', requestBody: '{"param1": "value1", "param2": "value2"}'
其中,url是请求的URL地址,contentType是请求的内容类型,httpMode是请求的方法(GET、POST等),requestBody是请求的参数。可以根据实际情况修改这些参数。
问题:2023-05-29 16:45:41.896823
jenkinsfile 像第三方发送请求 有多个参数,具体怎么写,用sh
答案: 可以使用curl命令来发送HTTP请求,具体的Jenkinsfile代码如下:
pipeline {
agent any
stages {
stage('Send HTTP Request') {
steps {
sh '''
curl -X POST \
-H "Content-Type: application/json" \