Package groovyx.net.http
HTTPBuilder provides a simple Groovy API for HTTP and REST client operations. It supports multiple callbacks based on response status code, and a mechanism to automatically parse and encode many common content-types such as XML, JSON, HTML, and plain text. HTTPBuilder also supports easy configuration for common authentication mechanisms, and common content-encodings as well.
Package Specification
The primary class is HTTPBuilder
, which
provides the most features and functionality.
RESTClient
,
AsyncHTTPBuilder
and
HttpURLClient
are variants provided
for more specialized use cases.
URIBuilder
is used by HTTPBuilder classes
for URL manipulation, but it may also be useful on its own. The remaining
classes provide supporting functions for HTTPBuilder and are probably only
useful for customizing or extending HTTPBuilder functionality.
Related Documentation
For overviews, tutorials, examples, guides, and tool documentation, please see: For content-type parser and encoder support, see:- Author:
- Tom Nichols
- See Also:
HTTPBuilder
,RESTClient
,URIBuilder
,AsyncHTTPBuilder
,HttpURLClient
-
Class Summary Class Description AsyncHTTPBuilder This implementation makes all requests asynchronous by submitting jobs to aThreadPoolExecutor
.AuthConfig Encapsulates all configuration related to HTTP authentication methods.ContentEncoding Base class for handing content-encoding.ContentEncodingRegistry Keeps track of available content-encoding handlers.DeflateEncoding Content encoding used to handle Deflate responses.EncoderRegistry This class handles creation of the request body (i.e.GZIPEncoding Content encoding used to handle GZIP responses.HTTPBuilder Groovy DSL for easily making HTTP requests, and handling request and response data.HttpContextDecorator HttpContext stores many transient properties of an HTTP request.HttpResponseDecorator This class is a wrapper forHttpResponse
, which allows for simplified header access, as well as carrying the auto-parsed response data.HttpURLClient This class provides a simplified API similar toHTTPBuilder
, but usesHttpURLConnection
for I/O so that it is compatible with Google App Engine.ParserRegistry Keeps track of response parsers for each content type.RESTClient Extension to HTTPBuilder that basically attempts to provide a slightly more REST-ful face on top of HTTPBuilder.URIBuilder This class implements a mutable URI. -
Enum Summary Enum Description ContentEncoding.Type Enumeration of common content-encodings.ContentType Enumeration of common IANA content-types.Method Enumeration of valid HTTP methods that may be used in arequest
call.Status Mapping of HTTP response codes to a constant 'success' or 'failure' value. -
Exception Summary Exception Description HttpResponseException Wraps an error response in an exception for flow control purposes.ResponseParseException Thrown when a response body is parsed unsuccessfully.