uberclient
v0.2.1
Published
Thin client for UBER Hypermedia Format
Downloads
2
Readme
uber.client.js
Javascript/Node.js Client for UBER hypermedia format.
Design Goals
Minimal, robust, extensible
Example 1:
var client = require('uberclient')
, token = '1234567890'; // You'd normally get this from a separate OAuth2 workflow
client.authProvider(client.authProviderTokenBased({'token' : token}));
client.request('http://api.froyo.io', function (error, msg) {
if (!error) {
var names = msg.query({"rel" : "urn:froyo_io:query:names"}).submit({"m" : "male"});
}
}, "read", "xml");
Example 2:
var url = 'https://raw.githubusercontent.com/inadarei/uber.client.js/master/test/fixtures/uber-sample.json';
client.request(url, function(error, uberMsg) {
if (!err) {
var appendPerson = uberMsg.query({"id" : "people"})
.query({"rel" : "http://example.org/rels/create"})
.submit({"g" : "irakli",
"f" : "nadareishvili",
"e" : "[email protected]"});
// Warning: .submit() implementation is in progress.
}
});
Full Documentation
You can see full documentation of the client at: http://jsclient.uberhypermedia.org