Package org.apache.pivot.web
Provides classes for communicating with HTTP-based web services.
Fundamentally, a web query is simply an HTTP request. However, the default data format used by a web query is not HTML, but JSON. This allows a caller to effectively invoke database-like operations over the web - the HTTP methods are used in a manner that is very similar to their corresponding SQL equivalents:
HTTP Method | SQL Query | Behavior |
---|---|---|
POST |
INSERT |
Create |
GET |
SELECT |
Read |
PUT |
UPDATE |
Update |
DELETE |
DELETE |
Delete |
These operations, sometimes referred to as "CRUD", form the basis of the Representational State Transfer (REST) model of building web services. Pivot web queries are designed primarily to facilitate interaction with JSON-based REST services. However, they are sufficiently generic to support communication with any type of HTTP-based service, using any data format (for example, XML). This enables web queries to be used in a broad range of server communication scenarios.
-
Interface Summary Interface Description Authentication Interface for attaching authentication information to a web query.QueryListener<V> Query listener interface. -
Class Summary Class Description BasicAuthentication Implementation of theAuthentication
interface supporting the HTTP Basic Authentication scheme.DeleteQuery Executes an HTTP DELETE operation.GetQuery Executes an HTTP GET operation.PostQuery Executes an HTTP POST operation.PutQuery Executes an HTTP PUT operation.Query<V> Abstract base class for web queries.Query.Status Query status codes.QueryDictionary Represents a collection of keyed data associated with a query.QueryListener.Adapter<V> Deprecated. Since 2.1 and Java 8 the interface itself has default implementations.QueryListener.Listeners<V> Query listener listeners list. -
Enum Summary Enum Description Query.Method Supported HTTP methods. -
Exception Summary Exception Description QueryException Thrown when an error occurs while executing a web query.