title: Alamofire encoding invalidURL
body: <p>Good afternoon all, newbie here trying to learn Swift / Alamofire. I've struggled with this for almost two days and am ready to move on.</p>
  
  <p>My URL appears to be created corrected, but I get an error when making the  request.  In looking at the Xcode debug logs, it looks like my single quotes are being escaped when the request is being sent.  </p>
  
  <pre><code>let owner : String = "me@corp.local"
  
  func getDeploymentsByOwner(token: String, owner: String, success: @escaping (JSON) -&gt; Void, failure: @escaping (Error) -&gt; Void) {
  
      let headers = [
          "Authorization": "Bearer \(token)",
          ]
      print(owner)
  
  
      let url = "https://corp.local?$filter=owners/ref eq '\(owner)'"
  
  
      // created URL is https://corp.local?$filter=owners/ref eq 'me@corp.local'
  
  
      Alamofire.request(url, method: .get, encoding: URLEncoding.queryString, headers: headers).responseJSON { (responseObject) -&gt; Void in
          if responseObject.result.isSuccess {
              let resJSON = JSON(responseObject.result.value!)
              success(resJSON)
          }
          if responseObject.result.isFailure {
              let error = responseObject.result.error
              print(error)
              failure(error!)
          }
      }
  </code></pre>
  
  <p>My error message looks like this
  // Xocde debug error</p>
  
  <pre><code>Optional(Alamofire.AFError.invalidURL("https//:corp.local?$filter=owners/ref eq \'me@corp.local\'"))
  invalidURL(https://corp.local?$filter=owners/ref eq \'me@corp.local\'")
  </code></pre>
  
  <p>I Can get all the items without $filter, so the request works as long as the filter is omitted.</p>
  
  <p>// Postman works with the generated URL, but the one with the backslashes () won't</p>