Created
October 28, 2017 02:07
-
-
Save dnaismyth/c2a717956220e46c4102744f47e1eac9 to your computer and use it in GitHub Desktop.
Testing Comment POST request
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 UIKit | |
| class CommentViewController: UIViewController { | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| // Create a test comment | |
| let comment = Comment() | |
| comment.author = "Dayna" | |
| comment.text = "This game is cool." | |
| let postUrl = Constants.URL.createGameComment.replacingOccurrences(of: "{gameId}", with: "1") // Create a comment on game with id = 1 | |
| Request.post(postUrl: postUrl, body: comment.convertToDictionary()) { (data) in | |
| OperationQueue.main.addOperation { | |
| print(data) | |
| } | |
| } | |
| // Do any additional setup after loading the view. | |
| } | |
| override func didReceiveMemoryWarning() { | |
| super.didReceiveMemoryWarning() | |
| // Dispose of any resources that can be recreated. | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment