title: Cannot invoke 'dataTask' with an argument list of type (with: NSMutableRequest, ...)
body: <p><a href="https://i.stack.imgur.com/RHyvs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RHyvs.png" alt="enter image description here"></a></p>
  
  <pre><code>func performGetRequest(_ targetURL: URL!, completion: @escaping (_ data: Data?, _ HTTPStatusCode: Int, _ error: NSError?) -&gt; Void) {
      let request = NSMutableURLRequest(url: targetURL)
      request.httpMethod = "GET"
  
      let sessionConfiguration = URLSessionConfiguration.default
  
      let session = URLSession(configuration: sessionConfiguration)
  
      let task = session.dataTask(with: request, completionHandler: { (data: Data?, response: URLResponse?, error: NSError?) -&gt; Void in
          DispatchQueue.main.async(execute: { () -&gt; Void in
              completion(data, (response as! HTTPURLResponse).statusCode, error)
          })
      })
  
      task.resume()
  }
  </code></pre>
  
  <p>Here I am trying a demo from appCoda to integrate YouTube API. But not able to move further because of this method error :</p>
  
  <p>Cannot invoke 'dataTask' with an argument list of type '(with: NSMutableURLRequest, completionHandler:(Data?, URLResponse..)'</p>