Created
January 28, 2020 00:02
-
-
Save mikebuss/eccf31d0a45f7564b788d62cd6f8a8d6 to your computer and use it in GitHub Desktop.
Query Devices in Swift
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
func queryForDevices() { | |
let rPi = URL(string: "http://10.3.141.1:8080/devices")! | |
let task = URLSession.shared.dataTask(with: rPi) {(data, response, error) in | |
guard let data = data else { return } | |
print(String(data: data, encoding: .utf8)!) | |
} | |
task.resume() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment