Created
April 7, 2017 01:50
-
-
Save Dispader/2dc9b9a9c9bb0af02137a865250266eb to your computer and use it in GitHub Desktop.
Self-contained Groovy Console example for using httpbuilder-ng.
This file contains 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
@Grab(group='io.github.http-builder-ng', module='http-builder-ng-apache', version='0.15.0') | |
public class UsedToExposeAnnotationToComplier {} | |
println 'ok computer' | |
import groovyx.net.http.HttpBuilder | |
def httpBin = HttpBuilder.configure { | |
request.uri = 'http://httpbin.org/' | |
} | |
def result = httpBin.get { | |
request.uri.path = '/get' | |
} | |
println "your IP address is: ${result.origin}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment