REST-S Messages
Introduction
The RestServerApp uses REST-S-… messages to communicate with other applications (such as the LogicApp) to handle inbound REST/HTTP(S) requests received from an external REST/HTTP(S) Client.
The following LuaApp agents from the core n2svcd module handle messages
from RestServerApp.
RestLuaService(handles inbound REST requests within LogicApp)
The internal REST-S-… messages are:
REST-S-REQUESTREST-S-RESPONSE
Note that this page uses the term “on-the-wire” to refer to the sending or receiving of REST content by the RestServerApp. This term is also inclusive of the case where the message is sent by local loopback and does not physically transit a Network Interface Controller (NIC).
REST-S-REQUEST
The REST-S-REQUEST message is sent by RestServerApp to the application that is configured
for handling of inbound REST requests.
Refer to the RestServerApp Configuration documentation for more information on setting default parameters.
The attributes of the REST-S-REQUEST message are:
| Attribute | Type | Description |
|---|---|---|
rest
|
Object | Container for the parameters of the REST request that we have received. |
.remote_host
|
String | The remote IP address from which the REST HTTP(S) request was sent. |
.remote_port
|
Integer | The remote IP port from which the REST HTTP(S) request was sent. |
.method
|
String | The HTTP Request method. |
.uri
|
String |
The URI for which the request was received. Includes only path and query. No host/port/auth/user/fragment is present. |
.path
|
String | The URI path. |
.query
|
String | The URI query string (the part following "?" in the URI). |
.content_type
|
String | The HTTP Request Content-Type header value. |
.content
|
String | The HTTP Request content. |
Note that SSL and security parameters are not placed into this message.
REST-S-RESPONSE
The REST-S-RESPONSE message is sent back to the RestServerApp by the handling application
when it is ready to send a HTTP Response to the original received HTTP Request.
The attributes of the REST-S-RESPONSE message are:
| Field | Type | Description |
|---|---|---|
success
|
0/1
|
[Required] Indicates if the request handling was successful or not. |
error
|
String |
Indicates the reason why the request handling failed. Present and applicable only if success == 0.
|
rest
|
Object |
Container for the REST response parameters we are to send. Present only if success == 1.
|
.code
|
Integer | The HTTP Response Status Code to send (e.g. 200) |
.content
|
String |
The HTTP Request content to send. (Default = None) |
.content_type
|
String | The HTTP Request Content-Type header value to send. |