title: Only Django request.body contains data (not request.POST)
body: <p>I am using forms in Django and trying to get the get the data back using <code>request.POST</code>, but this returns an empty dictionary for me: <code>&lt;QueryDict: {}&gt;</code>. When using <code>request.body</code>, however, I get the raw data back. How can I get the data from <code>request.POST</code> as well, because I do not want to work with raw data. The console output of the print statements are put in comments next to them.</p>
  <p>forms.py</p>
  <pre><code>class NameForm(forms.Form):
      first_name = forms.CharField(label='First name:', max_length=100)
      last_name = forms.CharField(label='Last name:')
  </code></pre>
  <p>views.py</p>
  <pre><code>@csrf_exempt
  def blank(request):
      form = NameForm()
      print(f&quot;request.body: {request.body}&quot;) # request.body: b'first_name=Adam&amp;last_name=Smith'
      print(f&quot;request.POST: {request.POST}&quot;) # request.POST: &lt;QueryDict: {}&gt;
  
      return render(request, 'blank.html', {'form': form})
  </code></pre>
  <p>blank.html</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang=&quot;en&quot;&gt;
      &lt;head&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;form action=&quot;&quot; method=&quot;post&quot;&gt;
              {{ form }}
              &lt;input type=&quot;submit&quot; value=&quot;Submit&quot;&gt;
          &lt;/form&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>