Hi I need to call a REST service as part of the buildscript (Gradle) without any 3rd party plugins, how could I use Groovy to do that?
(My first attempt)
repositories {
mavenCentral()
}
dependencies {
complie "org.codehaus.groovy.modules.http-builder:http-builder:0.5.2"
}
task hello {
def http = new HTTPBuilder("http://myserver.com:8983/solr/select?q=*&wt=json")
http.auth.basic 'username', 'password'
http.request(GET, JSON ) { req ->
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…