Skip to content
josedonizetti edited this page Feb 24, 2011 · 2 revisions

Opensearch

Restfulie client supports opensearch with both xml and json out of the box. Atom support can be included by adding a media type handler for atom.

The media type handler

The opensearch media type handler allows unmarshalling an open search descriptor file, such as:

SearchDescription description = restfulie.at("http://localhost:3000/products/opensearch.xml").accept("application/opensearchdescription+xml").get().getResource();

And now, a description object can be searched by invoking the use method:

items = description.use("application/xml").search(:searchTerms => what, :startPage => 1) List items = desc.use("application/xml").with(queryFor(term)).and(page(page)).get().getResource();

There is a sample application showcasing open search usage on the client side at restfulie-restbuy.

Clone this wiki locally