<commit_before># Http Builder NG, The Easy Http Client for Groovy (and Java)

## Quick Links for the Impatient

* Site: https://dwclark.github.io/http-builder-ng/
* Project: https://github.com/dwclark/http-builder-ng
* JavaDocs: https://dwclark.github.io/http-builder-ng/javadoc/
* User Guide: https://dwclark.github.io/http-builder-ng/guide/html5/

## Quick Overview

Http Builder NG is a modern Groovy DSL for making http requests. It requires Java 8 and a modern Groovy. It is built against Groovy 2.4.x, but it doesn't make any assumptions about which version of Groovy you are using. The main goal of Http Builder NG is to allow you to make http requests in a natural and readable way. For example:

```groovy
//let's configure an http client to make calls to httpbin.org using the default http library
def httpBin = HttpBuilder.configure {
    request.uri = 'http://httpbin.org/'
}

//now let's GET /get endpoint at httpbin.
//This will return a JSON formatted response with an origin property.
def result = httpBin.get {
    request.uri.path = '/get'
}
    
println("Your ip address is: ${result.origin}")

//Finally lets post a standard http form to httpbin
httpBin.post {
    request.uri.path = '/post'
    request.body = [ input1: 'the first input', input2: 'the second input' ]
    request.contentType = 'application/x-www-form-urlencoded'
}

```

Hopefully that gives you a flavor or how Http Builder NG works. Http Builder NG is designed to be compatible with Groovy code annotated with [@TypeChecked](http://docs.groovy-lang.org/latest/html/gapi/groovy/transform/TypeChecked.html) and [@CompileStatic](http://docs.groovy-lang.org/latest/html/gapi/groovy/transform/CompileStatic.html). It also makes use of the [@DelegatesTo](http://docs.groovy-lang.org/latest/html/gapi/groovy/lang/DelegatesTo.html) to provide better IDE support when writing code using Http Builder NG.

## Artifacts

Http Builder NG artifacts are available on [Bintay](https://bintray.com/davidwclark/dclark/http-builder-ng), for Gradle you can add the following dependency to your `build.gradle` file `dependencies` closure:

    compile 'org.codehaus.groovy.modules:http-builder-ng:0.10.2'
    
For Maven, add the following to your `pom.xml` file:

    <dependency>
      <groupId>org.codehaus.groovy.modules</groupId>
      <artifactId>http-builder-ng</artifactId><commit_msg>Fix bintray link, pointing to correct URL<commit_after># Http Builder NG, The Easy Http Client for Groovy (and Java)

## Quick Links for the Impatient

* Site: https://dwclark.github.io/http-builder-ng/
* Project: https://github.com/dwclark/http-builder-ng
* JavaDocs: https://dwclark.github.io/http-builder-ng/javadoc/
* User Guide: https://dwclark.github.io/http-builder-ng/guide/html5/

## Quick Overview

Http Builder NG is a modern Groovy DSL for making http requests. It requires Java 8 and a modern Groovy. It is built against Groovy 2.4.x, but it doesn't make any assumptions about which version of Groovy you are using. The main goal of Http Builder NG is to allow you to make http requests in a natural and readable way. For example:

```groovy
//let's configure an http client to make calls to httpbin.org using the default http library
def httpBin = HttpBuilder.configure {
    request.uri = 'http://httpbin.org/'
}

//now let's GET /get endpoint at httpbin.
//This will return a JSON formatted response with an origin property.
def result = httpBin.get {
    request.uri.path = '/get'
}
    
println("Your ip address is: ${result.origin}")

//Finally lets post a standard http form to httpbin
httpBin.post {
    request.uri.path = '/post'
    request.body = [ input1: 'the first input', input2: 'the second input' ]
    request.contentType = 'application/x-www-form-urlencoded'
}

```

Hopefully that gives you a flavor or how Http Builder NG works. Http Builder NG is designed to be compatible with Groovy code annotated with [@TypeChecked](http://docs.groovy-lang.org/latest/html/gapi/groovy/transform/TypeChecked.html) and [@CompileStatic](http://docs.groovy-lang.org/latest/html/gapi/groovy/transform/CompileStatic.html). It also makes use of the [@DelegatesTo](http://docs.groovy-lang.org/latest/html/gapi/groovy/lang/DelegatesTo.html) to provide better IDE support when writing code using Http Builder NG.

## Artifacts

Http Builder NG artifacts are available on [Bintay](https://bintray.com/http-builder-ng/dclark/http-builder-ng), for Gradle you can add the following dependency to your `build.gradle` file `dependencies` closure:

    compile 'org.codehaus.groovy.modules:http-builder-ng:0.10.2'
    
For Maven, add the following to your `pom.xml` file:

    <dependency>
      <groupId>org.codehaus.groovy.modules</groupId>
      <artifactId>http-builder-ng</artifactId>
{'fraction_non_alphanumeric': 0.10912531539108494, 'fraction_numerical': 0.004205214465937763, 'mean_word_length': 4.033862433862434, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 10, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3764433', 'n_tokens_mistral': 1529, 'n_tokens_neox': 1412, 'n_words': 499}