Cannot call value of non-function type HTTPURLResponse?
<p>I am working with Alamofire 4, in Swift 3.</p>

<p>I am getting an error saying </p>

<blockquote>
  <p>Cannot  call value of non-function type HTTPURLResponse? </p>
</blockquote>

<p>I'm trying to download an image and store it in cache, here is my code below, can anyone help?</p>

<pre><code>            request = Alamofire.request(post.imageUrl!).validate(contentType: ["image/*"]).response(completionHandler: { request,data, err  in


                if err == nil {
                    let image = UIImage(data: data!)!
                    self.showcaseImage.image = image
            FeedVC.imageCache.setObject(image, forKey: self.post.imageUrl!)

                }
            })
</code></pre>

<p>i found that i had to change the top part to just .response. but when i do that I cannot go to if err == nil bloc and set image as data. is there away to fix this. code below.</p>

<pre><code>request = Alamofire.request( post.imageUrl!).validate(contentType: ["application/json"]).response { response in
                debugPrint(response)

                if error == nil {
                    let image = UIImage(data: data!)!
</code></pre>

<p>all the best
Tony </p>