title: How to access get request data in django rest framework
body: <p>How to access GET request data in django rest framework. In the docs, they have mentioned "For clarity inside your code, we recommend using request.query_params instead of the Django's standard request.GET"</p>
  
  <p><a href="https://www.django-rest-framework.org/api-guide/requests/" rel="noreferrer">https://www.django-rest-framework.org/api-guide/requests/</a></p>
  
  <p>But when I use request.query_params.get('some_vaue') it gives me none even though I pass the data in the request body.</p>
  
  <p>sample code example:</p>
  
  <pre><code>class TestView(APIView):
      def get(self, request):
          test = request.query_params.get('test')
          print('data',test)
          ...
          ...
          ...
  </code></pre>
  
  <p>When I pass some value in the body of the request in postman and print the value, it actually prints None.</p>
  
  <p><strong>Update</strong></p>
  
  <p>Below is my axios code </p>
  
  <pre><code> axios.get(API_URL, {
              headers: {
                  'Content-Type': 'application/json'
              },
              params: {
                  page_num: 1, 
                  test: 'test data'
              }
          })
          .then(res =&gt; {
              console.log(res);
          })
          .catch(err =&gt; {
              console.log(err.response.data);
          });
  </code></pre>
  
  <p><strong>Re-Update:</strong></p>
  
  <p>For testing purpose I printed out the request object like </p>
  
  <pre><code>print(request.__dict__)
  </code></pre>
  
  <p>so it printed out </p>
  
  <pre><code>{'_request': &lt;WSGIRequest: GET '/api/my api url/?page_num=1&amp;test=test+data'&gt;, 'parsers': [&lt;rest_framework.parsers.JSONParser object at 0x0000016742098128&gt;, &lt;rest_framework.parsers.FormParser object at 0x00000167420980B8&gt;, &lt;rest_framework.parsers.MultiPartParser object at 0x00000167420980F0&gt;], 'authenticators': (), 'negotiator': &lt;rest_framework.negotiation.DefaultContentNegotiation object at 0x0000016742098080&gt;, 'parser_context': {'view': &lt;app_name.views.APIClassName object at 0x0000016742280400&gt;, 'args': (), 'kwargs': {}, 'request': &lt;rest_framework.request.Request object at 0x0000016742107080&gt;, 'encoding': 'utf-8'}, '_data': {}, '_files': &lt;MultiValueDict: {}&gt;, '_full_data': {}, '_content_type': &lt;class 'rest_framework.request.Empty'&gt;, '_stream': None, 'accepted_renderer': &lt;rest_framework.renderers.JSONRenderer object at 0x00000167421070B8&gt;, 'accepted_media_type': 'application/json', 'version': None, 'versioning_scheme': None, '_authenticator': None, '_user': &lt;django.contrib.auth.models.AnonymousUser object at 0x0000016741FFAC88&gt;, '_auth': None}
  </code></pre>
  
  <p>I could see that it is passing the data but not sure why if i do request.data['page_num'] or any other value it doesn't get the data.</p>