title: Jquery Ajax Send data to endpoint with POST
body: <p>I need to send som data to an endpoint. In the documentation it is written as product[xx][amount] where xx is an id.
  I can't figure out what the syntax should be.</p>
  <pre><code>var postData = {
              product:153,
              amount:1
            };
  </code></pre>
  <p>or</p>
  <pre><code>var postData = {
              product[153][1]
            };
  </code></pre>
  <p>maybe. But none of them works.</p>
  <p>The entire code is</p>
  <pre><code>var postData = {
              product:153,
              amount:1
            };
  
            $.ajax({
              url: '/actions/cart/add',
              type: 'POST',
              dataType: 'text',
              contentType: 'application/json',
              data: postData,
              success: function(data) {
                console.log('Data has been posted');
                console.log(data);
              },
              error: function(err) {
                console.log(err.statusText);
              }
            });
  </code></pre>
  <p>The response tells me that amount is missing.</p>