0

I'm trying to generate a Json Array like this:

{
  "PaymentItems": [
    {
      "id": "1",
      "paid": false
    },
    {
      "id": "2",
      "paid": false
    },
    {
      "id": "3",
      "paid": false
    }
  ]
}

I'm using the following code:

var transacciones_modificacion = [Transacctions]()
var elementos = [AnyObject]()
for item in transacciones_modificacion
{
  let jsonObjectPaid: [AnyObject]  = [[ "id": item.Id, "paid":item.Paid]] 
  elementos.append(jsonObjectPaid)    
}

let pagosArray = ["PaymentItems": [elementos]]

Anybody knows how can I see the json data sent to my server? thanks

rmaddy
  • 314,917
  • 42
  • 532
  • 579

0 Answers0