Skip to content

Instantly share code, notes, and snippets.

@kimukou
Created December 22, 2010 02:55
Show Gist options
  • Save kimukou/751022 to your computer and use it in GitHub Desktop.
Save kimukou/751022 to your computer and use it in GitHub Desktop.
asyncHttpClient_test.groovy
//see http://jfarcand.wordpress.com/2010/12/21/going-asynchronous-using-asynchttpclient-the-basic/
//see https://github.com/AsyncHttpClient/async-http-client
@GrabResolver (name='Sonatype', root='https://oss.sonatype.org/content/repositories/releases')
@GrabResolver (name='jboss', root='http://repository.jboss.org/nexus/content/groups/public-jboss/')
@Grab(group = 'com.ning', module='async-http-client', version='*')
import com.ning.http.client.*
import java.util.concurrent.Future
AsyncHttpClient client = new AsyncHttpClient()
Response response = client.prepareGet("http://sonatype.com").execute().get()
//Response response =client.preparePut("http://sonatype.com/myFile.avi").execute()
println response.dump()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment