title: API call issue - PHP /JavaScript
body: <p>If you check the below ajax header picture, I am able to pass the object in stringify format. Below code is of my api, which receives this header values.<br/> I am getting <code>Internal Server Error 500</code> .Please help.<Br/>
  <a href="https://i.stack.imgur.com/aP6i5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aP6i5.png" alt="enter image description here"></a></p>
  
  <pre><code>let param ={
        state_code:'11',
        products:JSON.stringify(productList),
        order_type:1
      }
      this.myserive.getCharges(param, () =&gt; {});
  </code></pre>
  
  <p>in API PHP </p>
  
  <pre><code>$products = isset($this-&gt;param['products']) ? json_decode($this-&gt;param['products'],true) : [];
  foreach($products as $p_id =&gt; $product){
                  $productWeight = 125;
                  $weight = (floatval($productWeight) * intval($product['quantity'])) / 1000;
                  $totalWeight += $weight;
                  $totalPrice += $product['price'];
              }
  </code></pre>
  
  <p>Note : To check productList value you can check the image link.</p>
  
  <p>To debug, I sent object without stringifying the object. and returned the $param in PHP API. I receive all params as it is from PHP API, except the prducts , it returns [object OBject] (string version of object.) (<strong>This means API call is proper</strong>) Thats why I did JSON.stringy for products before sending as param and then in php I am doing json_decode. But its giving 500 server error.</p>