0
I’m on my first project on Swift, and I need to send a RequestBody
in the POST by Alamofire.
This is an example of JSON I need to send:
{
"user":{
"email":"[email protected]"
}
}
And I have my Class User
.
func toDictionary() -> [String:Any]
{
var dictionary = [String:Any]()
if email != nil{
dictionary["email"] = email
}
return dictionary
}
I am using the SwiftyJSON
to do the parse.
My question is basically how I can transform my object, in this JSON structure that I need and send by Alamofire as POST.