How do I use JSON arrays with Alamofire parameters?

前端 未结 8 1997
借酒劲吻你
借酒劲吻你 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:14

    if you are using SwiftyJSON, you can write like this

    let array = ["2010-12-13T5:03:20","2010-12-13T5:03:20"]
     let paramsJSON = JSON(array)
     var arrString = paramsJSON.rawString(NSUTF8StringEncoding)
    

提交回复
热议问题