所以我正在使用Jenkins HTTP Requests插件来执行POST方法。我已经在标题中指定了授权和apiKey,并且与请求一起作为标题发送。我仍然收到401未经授权的错误。有什么我可能会想念的吗?
这是发出的请求:
def response_POST = httpRequest httpMode: 'POST', acceptType: 'APPLICATION_JSON', contentType: 'APPLICATION_JSON', requestBody: payload, url: endpoint, customHeader: [[name: 'Authorization', value: 'apiToken <token>'], [name: 'apiUser', value: 'test'], [name: 'api_key', value: <value>]]
以下是错误:
Response Code: HTTP/1.1 401 Unauthorized