私のサーバーは、アプリケーション側から辞書の配列を期待している問題で実行しています。私はtravel_configsalamafire(Postメソッド)を使用して迅速に辞書の配列を送信する方法
{
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)
}
- の下に、ここで間違ったコードを行くよどこ示唆してください、私はので、サーバーの例外をこのようにそれを送信する必要が辞書
の配列です
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"}]
travel_configsは辞書です。 ["Config_id": "9"、 "values": "train"]、["Config_id": "10"、 "values": "bus"]]は辞書の配列になります。 –
@ ShadowOfはい辞書の配列を作成していますが、私のサーバーはその辞書を受け入れていないので、私はサーバーから期待通りに送る必要があります。 –
@ ShadowOfそして、それを送信しているパラメータがnullになっています。 –