Introduction

The RESTAgent class is designed to simplify the management of client state when interacting with a hypermedia driven REST based API. Navigating Hypermedia APIs require you interact with a the service in specific ways. RESTAgent targets those particular interactions and aims to make them as noise free as possible.

A client application may use just one or many RESTAgents to achieve its goals.

Basic Operations

NavigateTo

This is the most commonly used operation and maps closely to the behaviour of a web browser when following an <a> tag. The CurrentContent of the RestAgent object will be updated to point to the new state that returns from dereferencing the link passed into the NavigateTo method.

Embed

This operation is equivalent to retrieving an image or stylesheet into a web page. It adds additional state to the current state. When you embed content you provide a label to facilitate access to this content. Embedded content is discarded following a NavigateTo, unless you explicitly request that it be moved into storage that has the same lifetime as the RESTAgent itself.

GetContent

With GetContent you can simply retrieve a representation, extract some information and then throw it away.

Relative links are resolved with respect to the current location.

State Management

Current Content

A RESTAgent class has both a current location and current content property. Conceptually, a RESTAgent can only be in one place at any point in time. Use the NavigateTo method to "transfer" to a new state.

Stored Content

You can use the RESTAgent to save certain representations to be used at a later point in time.

Bookmarks

You can use the RESTAgent to bookmark links that can be used later.

Hypermedia Content

Links

Semantics Registry

Media Type Registry

Link Registry

Missions

Last edited Apr 24, 2011 at 3:19 AM by DarrelMiller, version 4

Comments

No comments yet.