title: How do I add an array to my JSON dictionary in Swift
body: <p>I'm using swift in my ios app and I need help in creating the post request when an array is involved.</p>
  
  <p>I need to post in the body of the http request something along the lines of this JSON:</p>
  
  <pre><code>{
      "someProperty1":"someValue1",
      "someProperty2":"someValue2",
      "someArray":[
          {"name":"nameValue1", "email":"emailValue1", "anotherProperty":"anotherValue1"},
          {"name":"nameValue2", "email":"emailValue2", "anotherProperty":"anotherValue2"},
          {"name":"nameValue2", "email":"emailValue2", "anotherProperty":"anotherValue2"},
      ]
  }
  </code></pre>
  
  <p>I've been successful so far just creating a Dictionary for simpler requests that just looked like:</p>
  
  <pre><code>{"someProperty1":"someValue1",
  "someProperty2":"someValue2"}
  </code></pre>
  
  <p>and then using </p>
  
  <pre><code>NSJSONSerialization.dataWithJSONObject(requestBody, options: nil, error: &amp;err)
  </code></pre>
  
  <p>where "requestBody" is a Dictionary</p>
  
  <p>I have been unsuccessful in adding an array to this request can someone provide an example of how this might look? Thanks</p>