title: REST API calls not working in swift
body: <p>I'm following this tutorial for making a simple REST API call in swift: <a href="https://grokswift.com/simple-rest-with-swift/" rel="nofollow noreferrer">https://grokswift.com/simple-rest-with-swift/</a><br>
  The problem I'm running into is that the data task completion handler next gets executed. When I'm debugging it step by step, it just jumps over the completion handler block. Nothing is printed in the console, either.<br>
  I've searched for other methods of making REST API calls, but they are all very similar to this one and not working, either.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>    let endpoint: String = "https://jsonplaceholder.typicode.com/todos/1"
      guard let url = URL(string: endpoint) else {
          return
      }
      let urlRequest = URLRequest(url: url)
      let session = URLSession.shared
  
      let task = session.dataTask(with: urlRequest) { (data, response, error) -&gt; Void in
          guard error == nil else {
              print("Error calling GET")
              return
          }
          guard let responseData = data else {
              print("Error receiving data")
              return
          }
          do {
              print ("Parsing response...")
          }
      }
      task.resume()
  </code></pre>