请教Jenkinsfile关于httpRequest插件上传文件的语法
httpRequest httpMode: 'POST',
contentType: 'APPLICATION_OCTETSTREAM',
formData: [[body: '''{
"project_id" : "project",
"token" : "1111"
}''',
contentType: 'text/plain', fileName: 'project.exe', name: 'file',
uploadFile: 'bin/windows_amd64/111.txt']],
responseHandle: 'STRING', timeout: null,
url: 'http://xxx/trade/deploy/upload',
validResponseCodes: '200,404', validResponseContent: 'token',
consoleLogResponseBody: true
语法没有报错,但是接口返回“token不能为空”,说明token参数并没有接收到,我该怎么修改写法
上传接口为post请求,参数在body中,类型为form-data,
project: string
token: string
file: file
换官方提供的其他写法也是报token不能为空
formData: [
[contentType: 'multipart/form-data', name: 'token', body: '1111'],
[contentType: 'multipart/form-data', name: 'project_id', body: '${project_id}'],
[contentType: 'text/plain', name: 'file', fileName: '${project_id}.exe',
uploadFile: 'bin/windows_amd64/111.txt']]