Skip to content

Instantly share code, notes, and snippets.

@genericpenguin
Created January 10, 2016 22:07
Show Gist options
  • Save genericpenguin/7f3b5edafecfb335ac16 to your computer and use it in GitHub Desktop.
Save genericpenguin/7f3b5edafecfb335ac16 to your computer and use it in GitHub Desktop.
Error trying to add request interceptor to HTTPClient object in HTTPBuilder from Groovy postbuild plugin within an enclosing class
jira = new HTTPBuilder( url )
jira.client.addRequestInterceptor( new HttpRequestInterceptor() {
void process( HttpRequest httpRequest, HttpContext httpContext ) {
httpRequest.addHeader( 'Authorization', 'Basic ' +
"$username:$password".bytes.encodeBase64().toString() )
}
})
/* Error caused by code above
No signature of method: org.apache.http.impl.client.DefaultHttpClient.addRequestInterceptor()
is applicable for argument types:
(com.bigworldtech.ci.JiraConnection$1) values: [com.bigworldtech.ci.JiraConnection$1@343bc096]
21:39:20 Possible solutions: addRequestInterceptor(org.apache.http.HttpRequestInterceptor),
addRequestInterceptor(org.apache.http.HttpRequestInterceptor, int), getRequestInterceptor(int)
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment