RESTAgent is library that provides a layer on top of a HTTP library to make it easy to write applications that surf Hypermedia APIs.

Using standard HttpClient libraries with Hypermedia APIs can be frustrating because you frequently have to retrieve a resource, parse the response body, search for links within that body and then make another request using that link.

With RESTAgent that process becomes very simple:

var restAgent = new RestAgent();
restAgent.NavigateTo(new Link(“http://example.org”));
restAgent.NavigateTo(restAgent.CurrentContent.GetLink<SomeLink>());

One of the major benefits of a hypermedia API is that the last response from the server communicates “where you can go from here” by including links in the response.  In order to be able to take advantage of this information it is critical to know where “you currently are”.  Regular Http Client libraries have no state and therefore cannot assist with this.  However, RESTAgent always tracks your “location” in the API. 

RESTAgent has the notion of a semantics provider where you can register media type formatters, strongly type links and link extractors.  Once registered these classes are used automatically by RESTAgent to parse incoming representations, extract links from the document and make those links available as strong types.



The RESTAgent library includes:

  • an extensible registry of media type handlers so that responses will automatically be serialized into native content based on the content-Type header and links automatically parsed out.
  • A registry for Strong types for Links.
  • RESTAgent manages the current state of the hypermedia engine.
  • temporary bookmark manager to simplify access to frequently accessed resources.
  • ability to spawn and manage child RESTagents and can aggregate results from child agents.
  • missions to encapsulate a set of requests for reuse.

Benefits of using RESTAgent,
  • No dependency on any URI structure beyond the root URI.
  • Navigating resources can be done completely independently of media type as long as known media types are being used.
  • makes it easy to manage the client state of hypermedia driven applications.

Last edited Aug 23, 2011 at 3:28 AM by darrelmiller, version 8