This issue is archived. You can view it, but you can't modify it. Learn more

ExportXMLWordPrintable

      When I am using the plugin like below, it works fine:

      httpRequest customHeaders: [[name: 'Authorization', value: "Token harcodedtokenvaluehere"], [name: 'accept', value: "application/vnd.github.v3+json"]], httpMode: 'POST', requestBody: '{"head":"head","base":"base"}', url: "myurl"

      But when I try to use withCredentials to pass Token value through Jenkins credentials, job fails with Response Code: HTTP/1.1 401 Unauthorized.

      withCredentials([string(credentialsId: 'githubToken', variable: 'TOKEN')]) {

         httpRequest customHeaders: [[name: 'Authorization', value: "Token %TOKEN%"], [name: 'accept', value: "application/vnd.github.v3+json"]], httpMode: 'POST', requestBody: '

      {"head":"head","base":"base"}

      ', url: "myurl"

      }

            Assignee:
            Janario Oliveira
            Reporter:
            Rich
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: