Swift. Serialization of request parameters

Xcode
let requestParameters = [
"method": "createUser",
"credentials": [
"login": login,
"password": password,
"age": age,
"notificationSettings": [
"notifyNews": isNotifyNews,
"notifyCabinet": isCabinetNotify
]
]
]
struct LoginRequest: Codable {
struct Credentials: Codable {
struct NotificationSettings: Codable {
var notifyNews: Bool
var notifyCabinet: Bool
}

var login: String
var password: String
var age: Int
var notificationSettings: NotificationSettings
}

var method: String
var credentials: Credentials
}
let requestParameters = [
"email": email,
"firstName": firstName,
"age": age
]
email=example@example.com&firstName=Nickey&age=20
where Key == String

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store