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:- See Also:
-
ClassDescriptionThis implementation makes all requests asynchronous by submitting jobs to a
ThreadPoolExecutor
.Encapsulates all configuration related to HTTP authentication methods.This class is used to sign all requests via anHttpRequestInterceptor
until the context-aware AuthScheme is released in HttpClient 4.1.Base class for handing content-encoding.Enumeration of common content-encodings.Keeps track of available content-encoding handlers.Enumeration of common IANA content-types.Content encoding used to handle Deflate responses.This class handles creation of the request body (i.e.Content encoding used to handle GZIP responses.Groovy DSL for easily making HTTP requests, and handling request and response data.HttpContext stores many transient properties of an HTTP request.This class is a wrapper forHttpResponse
, which allows for simplified header access, as well as carrying the auto-parsed response data.Wraps an error response in an exception for flow control purposes.This class provides a simplified API similar toHTTPBuilder
, but usesHttpURLConnection
for I/O so that it is compatible with Google App Engine.This class basically wraps Signpost classes so they are not loaded untilHttpURLClient.setOAuth(Object, Object, Object, Object)
is called.Enumeration of valid HTTP methods that may be used in arequest
call.Keeps track of response parsers for each content type.Thrown when a response body is parsed unsuccessfully.Extension to HTTPBuilder that basically attempts to provide a slightly more REST-ful face on top of HTTPBuilder.Mapping of HTTP response codes to a constant 'success' or 'failure' value.Converts keys to strings, mainly to normalize the difference between GString and String keys since a GString will not produce the same hashcode as its equivalent string.This class implements a mutable URI.