Child pages
  • AtomPub Client
Skip to end of metadata
Go to start of metadata

An Atom Publishing Protocol Client

See Your first AtomPub Server for a server example.

Minimal required Maven dependency

Creating the AbderaClient instance

Create the AbderaClient

Retrieving resources (GET)

Retrieving resources using the AbderaClient is straightforward:

Retrieving resources

If the resource is not an XML document, the ClientResponse object can provide an InputStream

The ClientResponse object provides access to all of the response headers such as ETag and Last-Modified.

For headers that can contain encoded non-ASCII characters (like the Atompub Slug header), the ClientResponse will automatically decode the header. For instance, given the header "Slug: I%C3%B1t%C3%ABrn%C3%A2ti%C3%B4n%C3%A0liz%C3%A6ti%C3%B8n", resp.getSlug() returns the value "Iñtërnâtiônàlizætiøn".

Creating resources (POST)

Posting non-Abdera resources is also possible,

Updating resources (PUT)

Posting non-Abdera resources is also possible,

Deleting resources

Using Custom HTTP Methods

Custom HTTP methods can be used by calling the client.execute method

Customizing Request Options

The RequestOptions class is used to customize the options for a client request. The RequestOptions class provides access to all HTTP Request Headers

The RequestOptions can be modified for any type of request.

Using SSL

To use Abdera to access SSL-protected endpoints, you need to register a trust manager. Abdera ships with a default non-op Trust Manager implementation that is designed to make it possible to use SSL services without providing any level of trust verification.

By default, the Trust Manager will be registered on the default SSL port 443. If you want to register SSL support on a different port, you need to pass the port in when calling registerTrustManager

Alternatively, you can implement your own Trust Manager

Abdera also makes it possible to use SSL-based Client Certificate Authentication


Abdera can use HTTP Authentication mechanisms when requesting entries

This will tell the AbderaClient to use the specified credentials whenever prompted to perform basic authentication on the url "".

It is possible to use a custom Authentication mechanism by setting the Authorization header explicitly using the RequestOptions


While Abdera does not currently expose an API for working with HTTP cookies, the underlying HTTP client implementation supports and will use cookies within a single session. Cookies will not be stored permanently.


The Abdera Client includes a built-in HTTP Client Cache supporting the HTTP Cache-Control mechanism. The default cache implementation is an in-memory LRU cache that will not persist cached resources permanently. All of the standard cache-control mechanisms are supported with the notable exception that Vary response headers are not yet supported. When calling AbderaClient.get multiple times on a cached resource, if the cached copy is not stale, it will be returned.

The client cache can be disabled using the RequestOptions object,

It is also possible to use HTTP cache-invalidation mechanisms such as no-cache and max-age

Implementing a Custom Cache Implementation

Alternative Client cache implementations can be provided by implementing the Cache and CacheFactory interfaces. These are registered using the file META-INF/services/org.apache.abdera.protocol.client.cache.CacheFactory.

  • No labels

1 Comment

  1. I'm pretty sure that client cache factories are found in the file:


    (no 'client' in the name)