title: Json parsing django rest framework
body: <p>I want to parse incoming <code>POST</code> data in django views.py file </p>
  
  <p>POST data:</p>
  
  <pre><code>{
  "number" : "17386372",
  "data" : ["banana","apple","grapes" ]  
  }
  </code></pre>
  
  <p>Here is how I tried to read above incoming data with <code>request</code></p>
  
  <p>views.py</p>
  
  <pre><code>class Fruits(APIView):
  
  def post(self, request, format=None):
  
     if request.method == "POST":
  
          number = request.data.get('number')
          fruits_data = json.loads(request.body)
  
          if number not in [None, '', ' ']:
              try:
  
                  response = {"return": "OK","data":fruits_data['data']}
                  return Response(response)
              except:
                  return Response({"return": "NOT OK"})
          else:
              return Response({"return": "NOT OK"})
  
      else:
          return Response({"return": "NOT OK"})
  </code></pre>
  
  <p>ERROR:</p>
  
  <pre><code>You cannot access body after reading from request's data stream
  </code></pre>