title: Curl POST array of hashes
body: <p>I'm trying to reproduce a <code>cURL</code> to <code>POST</code> an array of hashes and having trouble with the syntax. This is the basic format I want:</p>
  
  <pre><code>curl -X POST http://localhost:3000/api/v1/shops -d \
    "shop[users][]=1 \
     &amp;shop[users][]=2\
     &amp;shop[users][]=c"
  </code></pre>
  
  <p>How do I turn the values <code>1</code>, <code>2</code>, and <code>c</code> into hashes?</p>
  
  <p>On my Rails API, I want the object to look like this:</p>
  
  <pre><code>{
    shop: {
      users: [
        {
          name: "Foo",
          age: 34
        },
        {
          name: "Bar",
          age: 12
        }
      ]
    }
  }
  </code></pre>
  
  <p><strong>Update</strong></p>
  
  <p>I tried the <code>here-doc</code> solution below but Rails parses that wrong, giving me:</p>
  
  <pre><code>{"{  shop: {    users: "=&gt;{"      {        name: \"Foo\",        age: 34      },      {        name: \"Bar\",        age: 12      }    "=&gt;{"  }}"=&gt;nil}},"action"=&gt;"create", "controller"=&gt;"shops"}
  </code></pre>