title: How to access redirected URL response from .POST HTTP request
body: <p>I'm trying to connect to a payment server, which is supposed to redirect me to another URL other than the one I have in my code.</p>
  
  <p>So I used Alamofire (.POST request) to connect to the server but I always enter the error case for "too many HTTP redirects" code=1007</p>
  
  <p>And I know that the server should return that, What I need is to print the URL the server tried to redirect me to in my xcode console.</p>
  
  <p>I have tried to use: </p>
  
  <pre><code>print(response.response?.allHeaderFields)
  </code></pre>
  
  <p>But didn't help in the output, Couldn't access the redirected URL.</p>
  
  <pre><code>let urlString = "http://www.gazdev.tk/PHP_VPC_3Party_Order_DO.php"
  Alamofire.request(urlString, method: .post, parameters: parameters,encoding: JSONEncoding.default, headers: nil).responseJSON {
      response in
      switch response.result {
      case .success:
          print(response.response)
          break
      case .failure(let error):
          print(response.response)
          print(error)
      }
  }
  </code></pre>
  
  <p>I get this as print statement: </p>
  
  <blockquote>
    <p>load failed with error Error Domain=NSURLErrorDomain Code=-1007 "too many HTTP redirects"</p>
  </blockquote>