【发布时间】:2019-01-14 05:25:48
【问题描述】:
我尝试了很多方法,但每次都失败了。 我想将 json 对象作为键值发布 关键是“数据” 键值为
{"totalcost":"8500","delivery_type":"take_away","order_name":"","order_mobilenumber":"","order_city":"Chose Your Place","order_address":"","take":" 2 Hour ","":[{"parent_id":"145","subitem_id":"179","quentity":"1"}],"customer_id":"6"}
我的代码是
let parameters: [String: Any] = [
"data":
["customer_id":"6",
"totalcost":"8500",
"delivery_type":"take_away",
"order_name":"",
"order_mobilenumber":"",
"order_city":"Chose Your Place",
"order_address":"",
"take_away_time":" Next 2 Hour ",
"":[
[
"parent_id":"145",
"subitem_id":"179",
"quentity":"1"
]
]
]
]
Alamofire.request("http:/app_con",method:.post,parameters:parameters,encoding:JSONEncoding.default).responseJSON{response in
let jsonResult = response.result.value
print(jsonResult)
}
我得到以下回应
{
message = "Please Try After Some Time";
status = error;
}
但是通过邮递员我得到了以下回应
{
message = "successfully submitted";
status = successful;
})
我尝试了很多方法,都没有为我解决。请给我您宝贵的建议。
谢谢
【问题讨论】:
-
你遇到了什么错误?
-
我在邮递员中发布了相同的参数,它给出的响应为'状态:“成功”'
-
但是通过上面的代码,得到状态错误
-
请在您的问题中添加您的错误。
-
没有错误,就是没有响应成功