如何使用具有整数列表的 json 参数使用 Alamofire 发送发布请求,即,我的服务器需要一个字典,其键值是一个整数列表。
我希望参数为 {"abc":[1,2,3]}。如何在 swift 中将其与 Alamofire 的 post 请求一起发送?
最佳答案
您尝试过以下方法吗?
var parameter = ["abc": [1,2,3]]
Alamofire.request(.POST, "http://www.yoursite.com/api" , parameters:parameter)
我还会查看 Alamofire github documentation 上的文档这真的很有帮助。
关于swift - 带有 json 编码的 Alamofire post 请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31499735/