c
#include <flux/core.h>
flux_msg_t *flux_request_encode (const char *topic, const char *s);
flux_msg_t *flux_request_encode_raw (const char *topic,
void *data,
int len);
Link with -lflux-core
.
flux_request_encode
encodes a request message with topic string topic
and optional NULL terminated string payload s
. The newly constructed message that is returned must be destroyed with flux_msg_destroy
.
flux_request_encode_raw
encodes a request message with topic string topic
. If data
is non-NULL its contents will be used as the message payload, and the payload type set to raw.
These functions return a message on success. On error, NULL is returned, and errno
is set appropriately.
- EINVAL
The topic argument was NULL or s is not NULL terminated.
- ENOMEM
Memory was unavailable.
:man3:flux_response_decode, :man3:flux_rpc