Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

swift urlsession remote json

if let url = URL(string: "https://api.myjson.com/bins/yfua8") {
   URLSession.shared.dataTask(with: url) { data, response, error in
      if let data = data {
         if let jsonString = String(data: data, encoding: .utf8) {
            print(jsonString)
         }
       }
   }.resume()
}
Source by calvinw.medium.com #
 
PREVIOUS NEXT
Tagged: #swift #urlsession #remote #json
ADD COMMENT
Topic
Name
3+8 =