如何在Alamofire中发布带有裸身的请求?

时间:2019-01-11 12:29:52

标签: ios swift alamofire

我想用Alamofire发布这个原始的尸体,我该怎么办?

[
    {
        "x": 234,
        "y": 1,
        "z": 10648
    }
]

1 个答案:

答案 0 :(得分:-1)

请尝试以下操作:

let param = ["x": "234", "y": "1", "z": "10648"]
Alamofire.request(requestURL, method: .post, parameters: param as? Parameters, encoding: JSONEncoding.default, headers: nil).responseJSON { (responseJson) in
     print("Response : \(responseJson)")
     if (responseJson.result.isSuccess){
         //Sucess Part

     } else {
          //Fail part
     }
}