grails/grails-http

Name: grails-http

Owner: grails

Description: Grails HTTP Utility Classes

Created: 2016-03-23 13:57:40.0

Updated: 2017-08-22 04:52:00.0

Pushed: 2016-03-30 13:28:34.0

Homepage: null

Size: 358

Language: Groovy

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Grails HTTP Utilities

This project contains HTTP utility classes generally useful across both client and server projects.

Initially there is an Asynchronous HTTP client available that is built on Netty and designed as replacement for the synchronous RestBuilder project for Grails.

The client is however usable outside of Grails and for any general purpose.

Example
import grails.http.client.*
import grails.async.*

AsyncHttpBuilder client = new AsyncHttpBuilder()
Promise<HttpClientResponse> p = client.post("https://localhost:8080/foo/bar") {
    contentType 'application/json'
    json {
        title "Ping"
    }
}
p.onComplete { HttpClientResponse resp ->
    assert resp.json.title == 'Pong'
}
Installation

To use the AsyncHttpBuilder class outside of Grails use the dependency directly:

compile "org.grails:http-client:VERSION"

Where VERSION is the version you wish to use. For usage within Grails there is a plugin:

compile "org.grails.plugins:async-http-builder:VERSION"

For more information see the documentation:


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.