我遇到了一个问题,我的服务器期望来自应用程序端的字典数组。请建议我在这里出错的地方,下面的代码
{
let param : [String : AnyObject] =
["trf_id" : Constant.constantVariables.trfID,
"mode" : Constant.modeValues.createMode,
"to_city" : Constant.constantVariables.to_city,
"from_city" : Constant.constantVariables.from_city,
"description" : Constant.constantVariables.descrption,
"request_type" : Constant.constantVariables.request_type,
"to_date" : Constant.constantVariables.to_date!,
"from_date" : Constant.constantVariables.from_date!,
"travel_configs" : ["Config_id" : "9","values" : "train",
"Config_id" : "10","values" : "bus"]]
print(param)
}
- travel_configs 是字典数组
由于服务器异常,我必须这样发送
trf_id:37
mode:1
request_type:0
from_city:sdfsd
to_city:qws
from_date:2016-08-17
to_date:2016-08-26
description:sdfsdf
travel_configs:[
{"config_id":"11","values":"1"}
,{"config_id":"2","values":"Flight"}]