let parameters = ["order": ["line_items": [
["variant_id": 18055889387589, "quantity": 11]]]] as [String : Any]
Alamofire.request(url, method: .post, parameters: parameters, encoding: JSONEncoding.prettyPrinted, headers: headers).responseJSON { response in
switch response.result {
case .success:
print("response is ",response)
case .failure(let error):
print(0,"Error")
}
}
答案 0 :(得分:-2)
let parameters = ["order": ["line_items": [
["variant_id": 18055889387589, "quantity": 11]]]] as [String : Any]
let jsonData = try! JSONSerialization.data(withJSONObject: parameters)
let jsonString = NSString(data: jsonData, encoding: String.Encoding.utf8.rawValue)
我认为问题在于您的参数请尝试这个