1
我試着去創建一個使用在迅速alamofire Web請求,通過請求對象應該是這樣的創建迅速字典與alamofire
{
"warranty": 0,
"descriptions": "string",
"product_name": "string",
"purchase_date": "23/10/2016",
"product_image": "string",
"product_receipt": "string",
"serial_number": "string",
"barcode_image": "string",
"serial_number_image": "string",
"product": {
"id": 1
},
"user": {
"id": 12
}
}
因此,爲了得到這個我已經把我的代碼,因爲這
let parameters :[String:AnyObject] = [
"warranty":product.warrenty,
"descriptions":product.longDescription,
"product_name":product.initialName,
"purchase_date":product.purchaseDate,
"serial_number":product.serialCode,
"product": [
"id":product.id
],
"user": [
"id":userDefaults.getCustomerId()
]
]
但我當我的要求去做,似乎服務器不接受這種格式,可能我的方式分配
"product": {
"id": 1
},
"user": {
"id": 12
}
不正確,這裏有什麼問題?可以有人指出我的問題,我在這裏做
y這工作謝謝:) –