title: My jQuery.ajax request POST data in PHP backend can not get
body: <p>I use my jQuery ajax to request PHP backend:</p>
  
  <pre><code>    jQuery.ajax({
          url: url,
          type: "POST",
          data: {
              qn_action: 'bmc',
              action: 'productdetails',
              id: 772,
              server_name: 'LL-01',
              tblclients_id: 1,
              bmc_action: 'on',
          },
          dataType: 'json',
          contentType: "application/json; charset=utf-8",
          success: function (data, textStatus){
  
              console.log('ldl:',data)
  
          },
          error: function(jqXHR, e) {
              var msg = '';
              if(jqXHR.status==0){
                  msg = 'You are offline!!\n Please Check Your Network.';
              }else if(jqXHR.status==404){
                  msg = 'Requested URL not found.';
              }else if(jqXHR.status==500){
                  msg = 'Internal Server Error.&lt;br/&gt;'+jqXHR.responseText;
              }else if(e=='parsererror'){
                  msg = 'Error: Parsing JSON Request failed.';
              }else if(e=='timeout'){
                  msg = 'Request Time out.';
              }else {
                  msg = 'Unknow Error.&lt;br/&gt;'+x.responseText;
              }
  
              console.log('error: '+jqXHR.responseText);
              console.log('Error msg: '+msg);
          }
      })
  </code></pre>
  
  <p>In the PHP backend:</p>
  
  <p>I want to check the request data: </p>
  
  <pre><code>echo json_encode(
    parse_str($_POST['qn_action'])
  );
  </code></pre>
  
  <p>there will get <code>ldl: – null</code> in the browser console. </p>
  
  <p>if I use </p>
  
  <pre><code>echo json_encode(
    $_POST['qiyun02_action']
  );
  </code></pre>
  
  <p>still get <code>ldl: – null</code>.</p>
  
  <p>if I use </p>
  
  <pre><code>echo json_encode(
    $_POST
  );
  </code></pre>
  
  <p>I will get <code>ldl: []</code>. </p>
  
  <p>so, how can I get the data from jQuery ajax request?</p>