12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- TWXrequest();
- function TWXrequest()
- {
- $params['date'] = time();//explode(' ', microtime())[1];
- $params['place'] = 'a84d0a15-08ec-11e5-829d-00155d6cab05';//Братское
- // $params['place'] = '5f2e4eca-4b02-11e1-b72e-001517e6ca10'; // Москва-Сортировочная.'5fb47130-580c-11e7-aefa-00155d6cab05';
- echo $params['date'];
- //$url = "http://62.141.88.61:8085/Thingworx/Things/connSmoppLibrary/Services/get_section_list";
- //$url = "http://qaplatform.digitaldepot.ru:8085/Thingworx/Things/connSmoppLibrary/Services/get_section_list";
- $url = "http://devplatform.digitaldepot.ru:8085/Thingworx/Things/connSmoppLibrary/Services/get_section_list";
- $jsonEncoded = json_encode($params);
- $curl = curl_init();
- curl_setopt($curl, CURLOPT_URL, $url);
- //curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "AppKey: 33cd23bb-3b03-4638-afef-7104a13e9211", "Accept:application/json"));
- curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "AppKey: 6a7bdbaa-6bc1-4159-a2f4-07a13c8907d1", "Accept:application/json"));
- // curl_setopt($curl, CURLOPT_USERPWD, sprintf('%s:%s', "Smopp", "2050.Digital"));
- curl_setopt($curl, CURLOPT_TIMEOUT, 240);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($curl, CURLOPT_POST, 1);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $jsonEncoded);
- curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
- curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
- // var_dump($jsonEncoded);
- $result = curl_exec($curl);
- curl_close($curl);
- //$uuid = json_decode($result)->RemarkId;
- // echo "uuid ".$uuid;
- // return $result;
- // $json = json_decode($result);
- //
- var_dump($result);
- }
- ?>
|