title: groovy.lang.MissingMethodException: No signature of method: httpRequest() is applicable for argument types: (java.util.LinkedHashMap)
body: <p>I have the following piece of code that used to work great in a pipeline. I have to move it into a shared library in Jenkins, so created a class for it and made the necessary adjustments.</p>
  <pre><code>    def toJson (input) {
         return groovy.json.JsonOutput.toJson(input)
      }
  
      def void callAPI (args) {
          def apiRequestBody = [
              &quot;prop1&quot;: args.param1,
              &quot;prop2&quot;: args.param2
          ]
   // Build the request - notice that authentication should happen seamlessly by using Jenkins Credentials
          response = httpRequest (authentication: &quot;${CREDENTIALS_STORED_IN_JENKINS}&quot;,
              consoleLogResponseBody: true,
              httpMode: 'POST',
              requestBody: toJson(apiRequestBody),
              url: &quot;${API_URL}&quot;,
              customHeaders: [
                  [
                      name: 'Content-Type',
                      value: 'application/json; charset=utf-8'
                  ],
                  [
                      name: 'Accept-Charset',
                      value: 'utf-8'
                  ]
              ]
          )
  </code></pre>
  <p>When I call the <code>callAPI (args)</code> method, I get the following error:</p>
  <blockquote>
  <p>Exception groovy.lang.MissingMethodException: No signature of method: MY_PACKAGE_PATH.MY_CLASS.httpRequest() is applicable for argument types: (java.util.LinkedHashMap) values: [[authentication:MYAPI_UID_PW, consoleLogResponseBody:true, ...]]</p>
  </blockquote>
  <p>What am I missing?</p>
  <p>Thanks</p>