         method:HTTPMethod,
         URLString:String,
         params:[String:AnyObject],
+        data:[String:AnyObject],
         json:[String:AnyObject]?,
         headers:CaseInsensitiveDictionary<String,String>,
-        data:NSData?,
+        requestBody:NSData?,
         URLQuery:String?
         ) -> NSURLRequest? {
             var body:NSData?


        completionHandler(.UseCredential, endCredential)
    }
    
    public func URLSession(session: NSURLSession, task: NSURLSessionTask, willPerformHTTPRedirection response: NSHTTPURLResponse, newRequest request: NSURLRequest, completionHandler: (NSURLRequest!) -> Void) {
        if let allowRedirects = taskConfigs[task.taskIdentifier]?.redirects {
            if !allowRedirects {


                var finalHeaders = headers

                if let requestData = requestBody {
                    body = requestData
                } else {
                    if let requestJSON = json {
                        body = NSJSONSerialization.dataWithJSONObject(requestJSON, options: NSJSONWritingOptions(0), error: nil)
                        finalHeaders["Content-Type"] = "application/json"
                    } else {
                        if data.count > 0 {
                            if headers["content-type"]?.lowercaseString == "application/json" { // assume user wants JSON if she is using this header
                                body = NSJSONSerialization.dataWithJSONObject(data, options: NSJSONWritingOptions(0), error: nil)
                            } else {
                                finalHeaders["Content-Type"] = "application/x-www-form-urlencoded"
                                body = query(data).dataUsingEncoding(NSUTF8StringEncoding)
                                if let length = body?.length {
                                    finalHeaders["Content-Length"] = "\(length)"
                                }
                            }
                        }
                    }
