How do I use JSON arrays with Alamofire parameters?

前端 未结 8 1911
借酒劲吻你
借酒劲吻你 2021-01-05 01:03

I\'m having a bit of trouble structuring my parameters so that our server API would be able to read it as valid JSON.

Alamofire uses parameters like this in swift la

8条回答
  •  悲&欢浪女
    2021-01-05 01:16

    You need to create a NSArray object for array parameters.

    var yourParameters = [
      "String": "a string",
      "Int": 1,
      "Array": NSArray(
        array: [
            "a", "b", "c"
        ])
    ]
    

提交回复
热议问题