pericmd 041: Riap::Simple

The last post (pericmd 040) describes the Riap protocol. Riap is an abstract protocol that does not specify how data should be transported on the wire. For that, two more protocols are defined: Riap::HTTP and Riap::Simple. The first one specifies how Riap is used with HTTP/HTTPS transport, and the second one is about how Riap can be transported over any stream socket (or pipe).

Since the latter is significantly simpler (even though it is lacking some nice features that Riap::HTTP provides), I’ll cover it first:

Request

Client sends Riap request in a single line: the letter “j” (lowercase), followed by the Riap request hash encoded as JSON (must all be in a single line), followed by CRLF.

Response

Server sends response in a single line also: the letter “j” (lowercase), followed by enveloped response array encoded as JSON (must all be in a single line), followed by CRLF.

If client or server sends invalid data, the connection can be closed.

That’s it.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s