I am using the following code to post an image to my server.
@IBAction func postButtonPressed(sender: UIButton) { let task = NSURLSession.sharedSession(
Well, in my case simply increasing the timeout of request solved the problem.