Created
December 22, 2010 02:55
-
-
Save kimukou/751022 to your computer and use it in GitHub Desktop.
asyncHttpClient_test.groovy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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