title: Get raw HttpRequest body in Micronaut
body: <p>I'm trying to get the <strong>raw</strong> request body in a Micronaut controller. The endpoint must consume application/json, but we need the raw json to generate a signature that must match a signature found in the header.  No matter what @Body type I set or even if I grab the HttpRequest.body, it has been modified. Unfortunately, I'm implementing a third-party API, else I would change the content-type to text/plain and all would work just fine.</p>
  
  <pre><code>@Consumes(MediaType.APPLICATION_JSON)
   @Post("/controlMessages")
   open fun recvControl2(@Header("signature")  signature: String, request: HttpRequest&lt;Any&gt;, @Body payload: Any): HttpResponse&lt;Any&gt; {
       LOG.info("body=${request.body.get()}")
  
       when(isBodyValid(signature, request.body.get())){
           true -&gt; return HttpResponse.ok()
           false -&gt; return HttpResponse.unauthorized()
       }
   }
  </code></pre>
  
  <p>Notice that the DefaultHttpClient shows the unmodified body</p>
  
  <pre>
  
      Sending HTTP Request: POST /controlMessages
      DefaultHttpClient - Chosen Server: localhost(27813)
      DefaultHttpClient - signature: 8e85acdb42cb5e14e15f1fbd954a8e98f1912fa1283bace5913
      DefaultHttpClient - host: localhost:27813
      DefaultHttpClient - connection: close
      DefaultHttpClient - content-type: application/json
      DefaultHttpClient - content-length: 103
      DefaultHttpClient - Request Body
      DefaultHttpClient - ----
      DefaultHttpClient - {"cancelControlMessages": [
       {"remoteId": "some-remote-id", "sentAt": "2019-11-06T14:55:15.603698Z"}
      ]}
      DefaultHttpClient?[0;39m - ----
      ControlController?[0;39m - body={"cancelControlMessages":[{"remoteId":"some-remote-id","sentAt":"2019-11-06T14:55:15.603698Z"}]}
  
  </pre>