FTN5: FutoIn HTTP integration Version: 0.1 Copyright: 2014 FutoIn Project (http://futoin.org) Authors: Andrey Galkin
Well, as mentioned in other specs, FutoIn project was born by influence of Web technologies in scope of Enterprise solutions. So, HTTP is fundamental communication channel (besides WebSockets).
Use cases:
Note: By definition of HTTP, only uni-directional message exchange is supported with no multiplexing on communication channel level.
Note: Executor must accept URI with or without trailing slash in path
on success, write response body as (one of):
JSON FutoIn response, if function has result variables
empty string (even though, there is no result, HTTP requires response)
FutoIn request and response messages must have application/futoin+json MIME-type. This type must be used ONLY for actual messages in Invoker-Executor dialog. In any other case, application/json should be used for messages.
Implementation must refuse to parse JSON as request or response message, if corresponding HTTP headers do not have correct MIME-type.
Invoker should assume Use Case #4, if response MIME-Type is not application/futoin+json.
URI is assumed as defined in its RFC3986 or any later version.
Note: Executor must behave equally with or without trailing slash in URI path part.
Generic format: "{end-point-URI}/{interface}/{version}/{function_name}"
Example: "https://api.example.com/futoin/some.interface.name/1.0/someFunc"
Query string starts with question mark "?". Parameters are separated with ampersand sign "&".
Example: "https://api.example.com/futoin/some.interface.name/1.0/someFunc?param1=val1¶m2=val2"
Note: the specifications uses unreserved by URI RFC3986 character classes to avoid extra coding needed.
JSON object is a tree-like structure. Each parent node is marked as object by added dot "." as separator right after parent node name.
JSON array is marked by adding plus sign "+" right after parent node name.
The function parameters object type is implicitly assumed and leading "." is forbidden.
Example:
{
"tree" : {
"subtree" : {
"node1" : "val1"
},
"node2" : "val2",
"array" : [
"item1",
{
"node3" : "val3"
}
]
}
}
would be coded as:
tree.subtree.node1=val1
tree.node2=val2
tree.array+=item1
tree.array+.node3=val3
In case if the same request parameter tree node is used in different contexts (as leaf, as object or as array). Executor must rise InvalidRequest.
=END OF SPEC=