title: Python Flask app unable to parse XML request data
body: <p>I wrote a simple flask app to parse XML requests and send a response. But when i try to parse the XML request, I get "unbound method get_data() must be called with Request instance as first argument (got nothing instead)".</p>
  
  <p>I've tried variations of get_data with arguments according to <a href="https://werkzeug.palletsprojects.com/en/0.15.x/wrappers/#werkzeug.wrappers.BaseRequest.get_data" rel="nofollow noreferrer">https://werkzeug.palletsprojects.com/en/0.15.x/wrappers/#werkzeug.wrappers.BaseRequest.get_data</a>' . I've also looked at a similar issue in SO, but that didn't help me.</p>
  
  <pre class="lang-py prettyprint-override"><code>from flask import Flask, Response, Request
  import xmltodict
  app = Flask(__name__)
  @app.route("/")
  def index():
      return "Hello"
  
  @app.route("/testapp", methods = ['POST'], strict_slashes=False)
  
  def parseRequest():
      content = xmltodict.parse(Request.get_data)
      print content
  
  if __name__ == "__main__":
      app.run(host='0.0.0.0')
  </code></pre>
  
  <p>I send request using curl</p>
  
  <pre><code>curl -i -X POST "http://x.x.x.x:5000/testapp" -H "accept: application/xml" -H "Content-Type: text/xml" --data @test.xml
  </code></pre>
  
  <p>This is the content of the XML file.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;soapenv:Envelope  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt;
      &lt;soapenv:Header xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
  ...
      &lt;/soapenv:Header&gt;
      &lt;soapenv:Body&gt;
          &lt;com:qRequest xmlns:com=http://masked1          
                  xmlns:xcom=http://masked2  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
              &lt;com:Query xsi:type="xcom:DynamicNamedQuery"&gt;
                  &lt;xcom:Identifier&gt;getDetails&lt;/xcom:Identifier&gt;
                  &lt;xcom:Parameters&gt;
                      &lt;paramvalue&gt;ABCDE&lt;/paramvalue&gt;
                  &lt;/xcom:Parameters&gt;
              &lt;/com:Query&gt;
          &lt;/com:qRequest&gt;
      &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>
  
  <p>This is the error I get - "TypeError: unbound method get_data() must be called with Request instance as first argument (got nothing instead)" . I've tried decoding it as utf8 as well, but I don't think that is the problem.</p>