recip_response

March 26, 2020 Contributors

Name

recip_response

Synopsis

#include "modules/rest/injector.h"

| void **recip_response** ( | closure, |   |
|   | msg, |   |
|   | sess, |   |
|   | resp, |   |
|   | req); |   |

void * <var class="pdparam">closure</var>;
ec_message * <var class="pdparam">msg</var>;
ec_httpsrv_session * <var class="pdparam">sess</var>;
struct json_object * <var class="pdparam">resp</var>;
struct json_object * <var class="pdparam">req</var>;

| int **has_restinj_recip_response_hook** ( | ); |   |

| void **register_restinj_recip_response_hook_first** ( | hook, |   |
|   | closure); |   |

ec_hook_restinj_recip_response_func_t <var class="pdparam">hook</var>;
void *<var class="pdparam">closure</var>;

| void **register_restinj_recip_response_hook_last** ( | hook, |   |
|   | closure); |   |

ec_hook_restinj_recip_response_func_t <var class="pdparam">hook</var>;
void *<var class="pdparam">closure</var>;

| void **call_restinj_recip_response_hook** ( | msg, |   |
|   | sess, |   |
|   | resp, |   |
|   | req); |   |

ec_message * <var class="pdparam">msg</var>;
ec_httpsrv_session * <var class="pdparam">sess</var>;
struct json_object * <var class="pdparam">resp</var>;
struct json_object * <var class="pdparam">req</var>;

Description

**Configuration Change. ** This hook is available as of version 3.1.2.

Called after populating a per-recipient response object in the JSON response for the session, regardless of whether that recipient was successfully generated or not. MSG is the associated ec_message, which may be NULL. SESS is the HTTP session handle. RESP is the JSON object encapsulating the recipient specific JSON response. REQ is the JSON object encapsulating the entire JSON request.

Implementors of this hook have the opportunity to take some action on the JSON RESP structure, by populating a key named "site". Hook implementors may inspect other keys in RESP, but SHOULD limit their actions to modifying the contents of the "site" key so that they do not collide with future expansions to the injection API.

REQ may contain a key named "site" that can be used to convey additional data to this hook.