Closed piroor closed 11 years ago
Envelope
request or signal:
{
id: "0123456789",
date: "2013-01-07T13:00:00+09:00",
body: "{...}"
}
response:
{
id: "abcdefg",
date: "2013-01-07T13:00:00+09:00",
replyTo: "0123456789",
body: "{...}"
}
The format of the body depends on the request type. So it should be discussed as another issue.
Should we include the statusCode in #3 in the envelope?
{
id: "abcdefg",
date: "2013-01-07T13:00:00+09:00",
replyTo: "0123456789",
statusCode: 200,
body: "{...}"
}
Should we use UNIX time for "date"?
{
id: "abcdefg",
date: "1357545175",
body: "{...}"
}
Note: the value should be string instead of integer, because JavaScript cannot handle very large number.
request/push:
{
id: "0123456789",
date: "2001-08-02T10:45:23.5+09:00",
statusCode: 200, // optional
type: "search-request", // create-table, remove-table, etc.
body: "{...}"
}
response:
{
id: "abcdefg",
date: "2001-08-02T10:45:23.5+09:00",
replyTo: "0123456789",
statusCode: 200,
type: "search-result", // create-table-result, remove-table-result, etc.
body: "{...}"
}
To indicate more detailed timestamps, we've decided to use the format: "YYYY-MM-DDThh:mm:ss.sTZD"
ex. 2001-08-02T10:45:23.5+09:00
Done.
Express-kotoumi will send a JSON string to kotoumi, and receive the result as a JSON string. We have to design the envelope and the body.