fix reconnectLte
[GitHub/Stricted/speedport-hybrid-php-api.git] / SpeedportHybrid.class.php
index 95f1f0cc9629d03a8b8a9ddfaa323fdeb1023da2..c135643cd5163d77b29c03fef5f52a4a9e0d8315 100644 (file)
@@ -14,7 +14,7 @@ require_once('lib/trait/System.class.php');
 /**
  * @author      Jan Altensen (Stricted)
  * @license     GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @copyright   2015 Jan Altensen (Stricted)
+ * @copyright   2015-2016 Jan Altensen (Stricted)
  */
 class SpeedportHybrid {
        use Connection;
@@ -114,18 +114,18 @@ class SpeedportHybrid {
         * @param       integer $count
         * @return      array
         */
-       private function sentRequest ($path, $fields, $cookie = false, $count = 0) {
-               $url = $this->url.$path.'?lang=en';
+       private function sendRequest ($path, $fields, $cookie = false, $count = 0) {
+               $url = $this->url.$path;
                $ch = curl_init();
                curl_setopt($ch, CURLOPT_URL, $url);
                
                if (!empty($fields)) {
+                       curl_setopt($ch, CURLOPT_POST, true);
+                       
                        if (is_array($fields)) {
-                               curl_setopt($ch, CURLOPT_POST, count($fields));
                                curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($fields));
                        }
                        else {
-                               curl_setopt($ch, CURLOPT_POST, $count);
                                curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
                        }
                }