Last active
April 6, 2016 07:41
-
-
Save flandy84/3edde5fb83f2eb659676c5593f287ff6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
public class LoginRequest { | |
public var userId: String = "" | |
public var password: String = "" | |
public init(userId: String, password: String) { | |
self.userId = userId | |
self.password = password | |
} | |
public init(json: JSON) { | |
userId = json["user"]["userId"].stringValue | |
password = json["user"]["password"].stringValue | |
} | |
public func toJSON() -> JSON{ | |
// { | |
// "user" : { | |
// "userId" : "USER", | |
// "password" : "PASS", | |
// } | |
// } | |
let bodyJSONDictionary = JSON( | |
[ "user" : | |
[ | |
"userId" : userId, | |
"password" : password, | |
] | |
]) | |
return bodyJSONDictionary | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment