                 }
                 
                 // Send the request, even if there are no logs to send (to keep track of device info)
-                if let request = buildLogSendRequest(analyticsSendCallback) {
+                if let request: BaseRequest = buildLogSendRequest(analyticsSendCallback) {
                     request.sendData(logPayloadData, withCompletionHandler: analyticsSendCallback)
                 }
             }

                }
                
                // Send the request, even if there are no logs to send (to keep track of device info)
                if let request = buildLogSendRequest(logSendCallback) {
                    request.sendData(logPayloadData, withCompletionHandler: logSendCallback)
                }
            }

            headers[Constants.analyticsApiKey] = Analytics.apiKey!
            
            logUploadUrl = "https://" + Constants.AnalyticsServer.Bluemix.hostName + "." + bmsClient.bluemixRegion! + Constants.AnalyticsServer.Bluemix.uploadPath
            
            // Request class is specific to Bluemix (since it uses Bluemix authorization managers)
            return Request(url: logUploadUrl, headers: headers, queryParameters: nil, method: HttpMethod.POST)
        }
        // MFP request
        else if let mfpProtocol = mfpClient.mfpProtocol, mfpHost = mfpClient.mfpHost, mfpPort = mfpClient.mfpPort {
            headers["Content-Type"] = "text/plain"
            
            logUploadUrl = mfpProtocol + "://" + mfpHost + ":" + mfpPort + Constants.AnalyticsServer.Foundation.uploadPath

            return BaseRequest(url: logUploadUrl, headers: headers, queryParameters: nil, method: HttpMethod.POST)
        }
        else {
            Logger.internalLogger.error("Failed to send logs because the client was not yet initialized. Make sure that either the BMSClient or the MFPClient class has been initialized.")
            return nil
        }
    }
    
    
