Module RPC

Modules are made available to remote systems by means of an HTTP interface. There are two types of requests a client may send to the module: (a) a module descriptor request, and (b) a processing request.

A remote module is identified by a URL, which should be something like: http://www.example.com/mymodule; then the processing request is sent to that URL, and the descriptor request is sent to http://www.example.com/mymodule/meta.

Module descriptor

If a client requests the module descriptor, the module should send a JSON object with the following variables:

description:
a free-text description of the module;
input:
a set of input pipe names and their content types;
output:
a set of output pipe names and their content types (there should be at most 1 output pipe; support for multiple pipes may be implemented some time).

The following is an example of a JSON module descriptor.

{"input":{"input":"text/plain"},"description":"Pipeline: alpino-kaf","output":{"output":"application/x-kaf-l1"}}

Processing

A processing request is sent as an HTTP POST request. If the module requires input, the data are sent as an HTTP file upload. More information on handling file uploads using a third-party webserver:

The module sends an HTTP response with status code OK (200) on success or an error code if the processing did not complete successfully.

See also: