5.9.5 SET
The SET command allows the program to include HTTP header properties in the HTTP request or response protocol.
Syntax:
Command |
Keyword |
Value |
Developer notes |
SET |
LIST |
value |
Conditional. XML or JSON bind list name. |
FRAGMENT |
value |
Conditional. XML or JSON bind fragment name. |
|
INSTRUCTION |
value |
Conditional. XML processing instruction. |
|
DATA |
value |
Conditional. Processing instruction data. |
|
PROPERTY |
*LIST |
Set HTTP header properties. |
The HTTP property name value pairs are passed as entries in a two-column working list.
The SET command can be called any time before the last SEND command that creates the HTTP request or response.
The LIST and FRAGMENT keywords are only available if the InboundXMLBind, OutboundXMLBind, InboundJSONBind or OutboundJSONBind handlers are being used.
The INSTRUCTION and DATA keywords are only available if the InboundXMLBind and OutboundXMLBind handlers are being used.
Example
DEFINE FIELD(#PNME) TYPE(*CHAR) LENGTH(20)
DEFINE FIELD(#PVAL) TYPE(*CHAR) LENGTH(20)
DEF_LIST NAME(#PLST) FIELDS((#PNME) (#PVAL)) TYPE(*WORKING)
CHANGE FIELD(#PNME) TO('''X-Invoice''')
CHANGE FIELD(#PVAL) TO(T9300)
ADD_ENTRY TO_LIST(#PLST)
USE BUILTIN(JSM_COMMAND) WITH_ARGS('SET PROPERTY(*LIST) SERVICE_LIST(PNME,PVAL)') TO_GET(#JSMSTS #JSMMSG #PLST)