       newParams = currentParams
     }
     
-    let signedParams = self.signatureParams(method, urlString: URLString, params: newParams)
-    for key in signedParams.keys {
-      newParams[key] = signedParams[key]
-    }
-    
     let request = super.request(withMethod: method, urlString: URLString, parameters: newParams, error: error)
+    addSignatureHeaders(request, method: method, urlString: URLString, params: newParams)
     
     return request
   }
   
   
-  open func signatureParams(_ method : String, urlString : String, params : [String : Any?]) -> [String : Any] {
+  open func addSignatureHeaders(_ request : NSMutableURLRequest, method : String, urlString : String, params : [String : Any?]) {
     
     let timestamp = String(format: "%d", Int(Date().timeIntervalSince1970))
     

    let signatureParam = components.joined(separator: "\n")
    let signature = signatureParam.sha256HMAC(withKey: clientSecret)
    
    var signedParams = [String : Any]()
    
    signedParams["auth_version"] = self.clientVersion
    signedParams["auth_client_id"] = self.clientId
    signedParams["auth_timestamp"] = timestamp
    signedParams["auth_signature"] = signature
    
    return signedParams
  }
  
  open func parameterString(_ params : [String : Any?]) -> String {


open class AFSignedHTTPRequestSerializer : AFJSONRequestSerializer {
  
  open var clientVersion = "4"
  open var clientId: String
  open var clientSecret: String
  
