RPC using Anything But XML (RABX) message parser and emitter
The RABX specification is a Perl module by mySociety.
Usage
require 'rabx/message'
Dump a RABX message:
RABX::Message.dump('R', 'RPC.method', ['argument', 3])
RABX::Message.dump('S', {name: 'foo', email: 'foo@example.com'})
RABX::Message.dump('E', 404, 'Not Found')
Load a RABX message:
message = RABX::Message.load("R1:0,10:RPC.method,L1:2,T8:argument,I1:3,")
message.type
message.method
message.argumetns
message = RABX::Message.load("S1:0,A1:2,T4:name,T3:foo,T5:email,T15:foo@example.com,")
message.type
message.value
message = RABX::Message.load("E1:0,3:404,9:Not Found,N")
message.type
message.code
message.text
message.extra
See the documentation to see how to work with RABX::Message
instances.
Notes
Generic RABX clients include:
mySociety has scripts to convert a Perl RABX server to a server-specific client in:
Copyright (c) 2014 James McKinney, released under the MIT license