Skip to content

Instantly share code, notes, and snippets.

@javazquez
Created May 16, 2015 15:44
Show Gist options
  • Save javazquez/7ff57562f257ca6ded09 to your computer and use it in GitHub Desktop.
Save javazquez/7ff57562f257ca6ded09 to your computer and use it in GitHub Desktop.
Basic Auth with Groovy
//Here is a quick groovy 1.7.4 Basic Auth Example
@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.5.0' )
def authSite = new groovyx.net.http.HTTPBuilder( 'http://10.110.201.115/~juanvazquez/basicAuth/' )
authSite.auth.basic 'test', 'this'
println authSite.get( path:'testAuth.html' )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment