【发布时间】:2018-10-19 09:20:28
【问题描述】:
["client_ID": "0", "username": "asdf@gmail.com", "grant_type": "password", "password": "12345", "client_secret": "xxxxxxxxxxxxxxxxxxxxx", "scope": "adfs.user"]
格式转换成这个
{"client_ID": "2", "username": "asdf@gmail.com", "grant_type": "password", "password": "12345", "client_secret": "xxxxxxxxxxxxxxxxxxxxx", "scope": "adfs.user"}
【问题讨论】:
-
问题是什么?
-
让 postString: 参数 = [ "grant_type" : GRANT_TYPE ,"client_ID" : CLIENT_ID ,"client_secret" : CLIENT_SECRET,"username" : emailString, "password" : passwordString,"scope" : ROLE]
-
抱歉,我们没有理解这个问题。你真正想要达到的目标是什么?您是否尝试将
Dictionary转换为 JSON 字符串? -
Alamofire 可以在发送数据时将 Swift 字典转换为 JSON 字典。你试过了吗?在lib的ReadMe中,有sample、explainations等。