title: Vapor HTTPClient follow redirect
body: <p>I can't figure out how to follow redirects from an external URL. The URL I am accessing is for some reason giving me 301, even though I don't get it in postman. I am wondering how I can get HTTPClient to follow the redirect or if I am doing anything wrong in order to get a 301.</p>
  
  <p>I did read <a href="https://github.com/vapor/vapor/pull/1480" rel="nofollow noreferrer">this PR</a>, but I don't think it is relevant anymore. Nor does the <a href="https://docs.vapor.codes/3.0/http/client/" rel="nofollow noreferrer">HTTPClient documentation</a> cover redirects.
  In the example below I've set the User-Agent to the same as Postman, in order to mimic Postman's request as much as possible.</p>
  
  <p>My code so far:</p>
  
  <pre><code>import Vapor
  import HTTP
  
  protocol DataFetching {
    func getFromURL(_ url: URL, on worker: Worker) throws -&gt; Future&lt;HTTPResponse&gt;
  }
  
  class DataFetcher: DataFetching {
  
    enum Error: Swift.Error {
      case unknown
    }
  
    func getFromURL(_ url: URL, on worker: Worker) throws -&gt; Future&lt;HTTPResponse&gt; {
  
      guard let host = url.host else { throw Error.unknown }
  
      var headers = HTTPHeaders()
      headers.replaceOrAdd(name: .userAgent, value: "PostmanRuntime/7.4.0")
      headers.replaceOrAdd(name: .accept, value: "*/*")
      headers.replaceOrAdd(name: .cacheControl, value: "no-cache")
      headers.replaceOrAdd(name: .applyToRedirectRef, value: "true")
      headers.replaceOrAdd(name: .acceptEncoding, value: "gzip, deflate")
  
      let httpRequest = HTTPRequest(method: .GET, url: url, version: HTTPVersion(major: 1, minor: 1), headers: headers)
  
      return HTTPClient.connect(hostname: host, on: worker).flatMap { client in
        return client.send(httpRequest)
      }
    }
  }
  </code></pre>
  
  <p>What am I missing?</p>