Right now I am making an Alamofire request with parameters. I need the final URL before the request is made because I need to hash the final URL and add it to the request header. This is how I was doing it but it does not give me the final URL to hash and put into a header.
Alamofire.request(url, method: .get, parameters: parameters, encoding: URLEncoding.default, headers: headers).responseJSON
I want to get the encoded URL before I make this request so the request looks like this
Alamofire.request(url, method: .get, headers: headers).responseJSON
Right now as a work around, I am creating the URL manually by appending each parameter manually. Is there a better way to do it?
let rexUrl = "https://www.google.com"
let requestPath = "/accounts"
let url = rexUrl + requestPath + "?apikey=\(apiKey)&market=USD&quantity=\(amount)&rate=\(price)&nonce=\(Date().timeIntervalSince1970)"