-3

I want to post this raw body with Alamofire, how I can do it?

[
    {
        "x": 234,
        "y": 1,
        "z": 10648
    }
]
rmaddy
  • 314,917
  • 42
  • 532
  • 579

1 Answers1

-3

Please try this:

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
     }
}
rmaddy
  • 314,917
  • 42
  • 532
  • 579
Sanjukta
  • 1,057
  • 6
  • 16