         if let pType = PacketType(rawValue: type) {
             var arr = [NSData]()
 
-            if data != nil {
-                for d in data! {
+            if let data = data {
+                for d in data {
                     arr.append(d as! NSData)
                 }
             }


            postWait.append(strMsg)

            if datas != nil {
                for data in datas! {
                    let (_, b64Data) = createBinaryDataForSend(data)

                    postWait.append(b64Data!)

            reqPolling.allHTTPHeaderFields = headers
        }
 
        if let extraHeaders = extraHeaders {
            for (headerName, value) in extraHeaders {
                reqPolling.setValue(value, forHTTPHeaderField: headerName)
            }
        }
