All Projects → grails → Grails Http

grails / Grails Http

Licence: apache-2.0
Grails HTTP Utility Classes

Programming Languages

groovy
2714 projects

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.

  • Build Status

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:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].