I have a model class like this
class Example() {
var name:String?
var age:String?
var marks:String?
}
I'm adding data to that model class
let example = Example()
example.name = "ABC"
example.age = "10"
example.marks = "10"
After that I converted to JSON then I posted
Alamofire.request(URL, method:.post, parameters: example)
Alamofire not accepting parameters only its accepting like parameters = ["":"","",""]-->key value based
, so I tried to convert model to JSON, JSON to dictionary, even though not accepting its showing like parameters problem. Exactly I need total model object need to send as a parameter of post method in Alamofire like this:
let example = Example()
Alamofire.request(URL, method:.post, parameters: example)