title: Howto extract data from the JSON body of REST request inside a WSO2 ESB Synapse handler
body: <p>I'm writing a custom Handler for WSO2 ESB to construct authentication credentials based on input request content. Right now what I have is something like this:</p>
  
  <pre><code>public boolean handleRequest(MessageContext context) {
      // TODO: extract relevant information (clientId) from JSON request body
      String clientId;
  
      Map&lt;String, String&gt; headers = (Map&lt;String, String&gt;) ((Axis2MessageContext) context).getAxis2MessageContext().getProperty(
              org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
  
      setAuthorization(headers, clientId);
  
      return true;
  }
  </code></pre>
  
  <p>I can't find documentation regarding howto access REST JSON request body inside the Synapse handler. Any ideas? Is possible to define a property before the handler runs and capture it with something like <code>String clientId = (String)context.getProperty("clientId")</code>?</p>