Hapi is a project mainly written in Ruby, based on the MIT license.
Generic HTTP API wrapper
HAPI provides a generic abstraction layer for dealing with simple HTTP APIs that return XML content.
gem install hapi
Making an API call is a simple matter.
The XML content result is parsed by xml-object and returned at a Ruby object for simplicity.
require 'hapi'
h = HAPI::APICall.new "https://path.to/my/api"
h.params = {'user' => 'rodjek, 'foo' => 'bar'}
response = h.post
i.e.
<response>
<result>
<command>foo</command>
<code>0</code>
</result>
</response>
Can be accessed as follows
response.result.command
=> "foo"
response.result.code
=> "0"
Copyright (c) 2010 Tim Sharpe. See LICENSE for details.