HTTP Request in swift not working
Try adding this line of code:
URLCache.shared = URLCache(memoryCapacity: 0, diskCapacity: 0, diskPath: nil)
For Swift 3/Xcode 8.2.1, combining a couple of the answers (rv1331, Wouter van Zuilen) gave the best results with no errors in Playground. I'm using this Swift 3 REST example:
import PlaygroundSupportimport FoundationPlaygroundPage.current.needsIndefiniteExecution = trueURLCache.shared = URLCache(memoryCapacity: 0, diskCapacity: 0, diskPath: nil)
Swift 3 code:
<!-- language: lang-c -->import PlaygroundSupportPlaygroundPage.current.needsIndefiniteExecution = true