title: How can I convert request data to json or dict format
body: <p>From the client side, I receive some data by ajax post. The data type is json format.</p>
  
  <pre><code>function sendProjectBaseInfo() {
  
      prj = {
          id : $('#id').val(),
          email : $('#email').val(),
          title : $('#title').val(),
      }
  
      $.ajax({
          url: '/prj/',
          type: 'POST',
          contentType: 'application/json; charset=utf-8',
          dataType: 'json',
          data: prj,
          success: function(result) {
              alert(result.Result)
          }
      });
  }
  </code></pre>
  
  <p>After got the json data, I try to convert to json, or dict format.
  To convert to json. I wrote like this:</p>
  
  <pre><code>import json
  
  def post(self, request):
      if request.is_ajax():
          if request.method == 'POST':
              json_data = json.loads(request.data)
              print('Raw Data : %s'%request.body)
      return HttpResponse('OK!')
  </code></pre>
  
  <p>in case of above, I got 500 Internal server Error.</p>
  
  <p>So I wrote like below to work around this error.</p>
  
  <pre><code>import json
  
  def post(self, request):
      if request.is_ajax():
          if request.method == 'POST':
              data = json.dumps(request.data)
              print('Raw Data : %s'%request.body)
      return HttpResponse('OK!')
  </code></pre>
  
  <p>After all I got the same error. So I was look into the requested data.</p>
  
  <pre><code>import json
  
  def post(self, request):
      if request.is_ajax():
          if request.method == 'POST':
              print('Raw Data : %s'%request.body)
      return HttpResponse('OK!')
  </code></pre>
  
  <p>Print out is :</p>
  
  <pre><code>Raw Data : b'{"id":"1","email":"jason@test.co","title":"TEST"}'
  </code></pre>
  
  <p>How can I overcome this situation?</p>