This function is used to issue a request with alphanumeric data to a NATS subject and receive a response.
Note: the subject must not be linked to a JetStream flow.
Context
Windows client
Windows server
Java client
Java server
Adelia Web Client
Adelia Cloud client
Event Adelia client
Parameters
NUM_BIN_4 | Handle | Connection ID |
ALPHA | Subject | Message subject. |
NUM_BIN_4 | Headers | List of headers for the message, in the form of a list of key/value pairs separated by semi-colons. Several values can be provided for a header by separating them with a comma. If the commas or semi-colons need to appear in the header value, you need to replace them with the following escape characters respectively: %2c and %3b. |
ALPHA | Message | Message body |
NUM_BIN_4 | Timeout | Request results wait time |
IMAGE | ResponseHeaders | Response headers. Output parameter. |
NUM_BIN_4 | ResponseHeadersLength | ResponseHeaders variable length. |
ALPHA | Response | Response body. The response data is assumed to be a character string encoded in UTF-8. Output parameter. |
NUM_BIN_4 | ResponseLength | Response parameter length. |
NUM_BIN_4 | Rc | Function return code. The possible values are provided in NatsLastError function documentation. |
Example
ALPHA(32000) Response
ALPHA(32000) ResponseHeaders...
CALL_DLL 'NatsToolBx' 'NatsRequestString' Handle 'test.subject' *BLANK 'Test message' 500 ResponseHeader 32000 Response 32000 Rc