看板 MacDev 關於我們 聯絡資訊
請問 我要使用Alamofire Post val=[ { "apple": "", "bababa": "", "orange": "2946", "lemon": "12051852", "water": "5" } ] 這個JSON Alamofire.request("http://123", method: .post, parameters: PassData ).responseJSON { response in 請問我的PassData這邊要怎麼設定呢 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 125.230.61.159 ※ 文章網址: https://www.ptt.cc/bbs/MacDev/M.1479309785.A.BFF.html
tkdmaf: PassData的格式是Dictionary不是嗎? 11/17 00:06
tkdmaf: 基本上把你的{}拿掉就是Dictionary了! 11/17 00:07
tkdmaf: 但如果你是要把json轉成dictionary的話,則是拿掉[] 11/17 00:08
tkdmaf: 再如果你是複數資料量的話,就考慮整個用string傳了 11/17 00:10
tentenlee: val應該是json格式 他是要送array裡面有多筆吧 11/17 11:08
tentenlee: http://tinyurl.com/htpp8e5 官方文件有提到 11/17 11:11
tentenlee: 你要送array的話要用這個 http://tinyurl.com/jd7w5c3 11/17 11:12