// retrieve the request body
String body = StringUtil.streamToString(req.getInputStream());
jsonRequest = new JSONRequest(body);
// TODO: append authorized sender url to the request parameters
RequestParams requestParams = new RequestParams();
requestParams.put(Sender.class, null);
// invoke the agent
jsonResponse = agentFactory.invoke(agentId, jsonRequest, requestParams);
} catch (Exception err) {
// generate JSON error response