title: Get POST request body as JSON of array as root node in flask-restful
body: <p>Using <code>flask-restful</code> I'm trying to capture a JSON array passed into the body of a POST request, but can't seem to find it using the <code>RequestParser</code>, any ideas?</p>
  <p>Currently my code looks like this:</p>
  <pre class="lang-py prettyprint-override"><code># api.py
  from flask import Flask
  from flask_restful import Api
  from resources import CustomRange
  app = Flask(__name__)
  api = Api(app)
  
  api.add_resource(CustomRange, '/customrange/&lt;start&gt;/&lt;end&gt;')
  
  app.run()
  
  # resources.py
  from flask_restful import Resource, reqparse
  parser = reqparse.RequestParser()
  
  parser.add_argument('data', action=&quot;append&quot;)
  #parser.add_argument('data', type=int, location=&quot;json&quot;)
  #parser.add_argument('data', type=int, location=&quot;form&quot;)
  #parser.add_argument('data', location=&quot;json&quot;)
  #parser.add_argument('data', location=&quot;json&quot;, action=&quot;append&quot;)
  #parser.add_argument('data', type=list)
  #parser.add_argument('data', type=list, location=&quot;json&quot;)
  #parser.add_argument('data', type=list, location=&quot;form&quot;)
  ## None of the above variants seem to capture it
  
  class CustomRange(Resource):
      def post(self, start: int, end: int):
          args = parser.parse_args()
          return args  # Always {'data': None}
  </code></pre>
  <p>I tried a simple example of passing the following into the POST body:</p>
  <blockquote>
  <p>[1, 2, 3]</p>
  </blockquote>
  <p>But no dice. Even tried without <code>parser.add_argument</code>.</p>
  <p>Here's the full test request that I'm using:</p>
  <pre class="lang-sh prettyprint-override"><code>curl --location --request POST '127.0.0.1:5000/customrange/1/100' \
  --header 'Content-Type: application/json' \
  --data-raw '[1, 2, 3]'
  </code></pre>