function URL_AJAX($method, $url, $data){ $curl = curl_init(); switch ($method){ case "POST": curl_setopt($curl, CURLOPT_POST, 1); if ($data) curl_setopt($curl, CURLOPT_POSTFIELDS, $data); break; case "PUT": curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT"); if ($data) curl_setopt($curl, CURLOPT_POSTFIELDS, $data); break; default: if ($data) $url = sprintf("%s?%s", $url, http_build_query($data)); } // OPTIONS: curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_HTTPHEADER, array( 'APIKEY: 111111111111111111111', 'Content-Type: application/json', )); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); // EXECUTE: $result = curl_exec($curl); if(!$result){die("Connection Failure");} curl_close($curl); return $result; }
- 3D Max (1)
- 3D 列印 (5)
- 8051 (1)
- Amazon Echo (1)
- Android (38)
- Android NDK 語言 (3)
- Android 系統底層 (27)
- arduino (22)
- ARVR (1)
- Beaglebone (5)
- Boo (1)
- cococs2d-x LUA (11)
- Cocos2d-x (4)
- Cubieboard (1)
- DB (4)
- DJI 大疆無人機 (1)
- Docker (5)
- Drone-APM (10)
- Drone-PX4 (4)
- Git (1)
- Google (1)
- IAR (5)
- iFrogLAB (15)
- iOS (9)
- javascript (16)
- Jquery (10)
- Lego (1)
- Line (1)
- Linux (47)
- Linux Driver (13)
- Mac (11)
- MSP430 (1)
- OpenCV (42)
- PHP (10)
- POS (2)
- Python (6)
- QT (6)
- Raspberry Pi (48)
- Raspberry pi 2 (1)
- Robot (5)
- Sensor感應器 (1)
- STm32L152c-Discovery (1)
- Swift (7)
- TensorFlow (10)
- unity3D (6)
- web (8)
- win 7 Mobile 技術文章 (1)
- Windows 10 IoT Core (2)
- windows 8 (2)
- windows 8 phone (2)
- Windows 8 WDK (1)
- wordpress (58)
- Yocto (1)
- 文章 (146)
- 智能電視 (3)
- 機器人 (2)
- 機械 (2)
- 烘焙 (5)
- 甜心一點DIY烘焙坊 (79)
- 硬體 (6)
- 網路APP安全 (5)
- 軟體開發工具 (3)
- 量化分析投資 (6)