title: Obtaining XML in the Request Body for Post in Nest.js
body: <p>I am curious if it is possible to obtain XML data in the Request Body of Nest.js.</p>
  
  <h2>Dependencies</h2>
  
  <pre><code>"dependencies": {
      "@nestjs/common": "^7.0.0",
      "@nestjs/core": "^7.0.0",
      "@nestjs/platform-express": "^7.0.0",
  </code></pre>
  
  <h2>Requirement</h2>
  
  <p>I wish to have an HTTP POST API called <code>/EPCIS/capture</code> that would obtain XML documents like the following:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
  &lt;epcis:EPCISDocument
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:epcis="urn:epcglobal:epcis:xsd:1"
      xmlns:epcglobal="urn:epcglobal:xsd:1"
      xsi:schemaLocation="urn:epcglobal:epcis:xsd:1 EPCglobal-epcis-1_0.xsd"
      creationDate="2008-03-16T22:13:16.397+01:00"
      schemaVersion="1.0"&gt;
    &lt;EPCISBody&gt;
      &lt;EventList&gt;
        &lt;ObjectEvent&gt;
          &lt;eventTime&gt;2008-03-16T22:13:16.397+01:00&lt;/eventTime&gt;
          &lt;eventTimeZoneOffset&gt;+01:00&lt;/eventTimeZoneOffset&gt;
          &lt;epcList&gt;
            &lt;epc&gt;urn:epc:id:sgtin:0614141.107346.2017&lt;/epc&gt;
            &lt;epc&gt;urn:epc:id:sgtin:0614141.107346.2018&lt;/epc&gt;
          &lt;/epcList&gt;
          &lt;action&gt;OBSERVE&lt;/action&gt;
          &lt;bizStep&gt;urn:epcglobal:epcis:bizstep:fmcg:shipped&lt;/bizStep&gt;
          &lt;disposition&gt;urn:epcglobal:epcis:disp:fmcg:unknown&lt;/disposition&gt;
          &lt;readPoint&gt;
            &lt;id&gt;urn:epc:id:sgln:0614141.07346.1234&lt;/id&gt;
          &lt;/readPoint&gt;
          &lt;bizLocation&gt;
            &lt;id&gt;urn:epcglobal:fmcg:loc:0614141073467.A23-49&lt;/id&gt;
          &lt;/bizLocation&gt;
          &lt;bizTransactionList&gt;
            &lt;bizTransaction type="urn:epcglobal:fmcg:btt:po"&gt;
              http://transaction.acme.com/po/12345678
            &lt;/bizTransaction&gt;
          &lt;/bizTransactionList&gt;
        &lt;/ObjectEvent&gt;
      &lt;/EventList&gt;
    &lt;/EPCISBody&gt;
  &lt;/epcis:EPCISDocument&gt;
  </code></pre>
  
  <p>Within my Controller:</p>
  
  <pre class="lang-js prettyprint-override"><code>
  Post('capture')
      addEPCDocument(@Body() epcDocument: any): any {
          console.log(epcDocument)
      }
  </code></pre>
  
  <p>But all I get is <code>{}</code> when logging the incoming Request Body. My POSTMAN setting already mentions:</p>
  
  <p><code>Content-Type: application/xml</code></p>
  
  <p>and within the <code>Body</code> I have the above mentioned XML pasted. The Response is HTTP 400 Bad Request.</p>
  
  <p>What is normally a way to extract XML from the Request Body in Nest.JS?</p>