-
Notifications
You must be signed in to change notification settings - Fork 0
/
section_contents.php
33 lines (27 loc) · 1 KB
/
section_contents.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
include 'headers.php';
require_once 'guzzle.phar';
// http://server_ip:server_port/library/sections/sectionID/all - skip the sections and just get them all
$server_ip = $_GET['server_ip'];
$server_port = $_GET['server_port'];
$sectionID = $_GET['sectionID'];
$token = $_GET['token'];
$client = new Guzzle\Service\Client('http://' . $server_ip);
$commandURL = '/library/sections/' . $sectionID . '/all?' . TOKEN_PARAM . '=' . $token;
$request = $client->get($commandURL, array(
'Content-Length' => 0,
HEADER_PLATFORM => VALUE_PLATFORM,
HEADER_PLATFORM_VERSION => VALUE_PLATFORM_VERSION,
HEADER_PROVIDES => VALUE_PROVIDES,
HEADER_PRODUCT => VALUE_PRODUCT,
HEADER_VERSION => VALUE_VERSION,
HEADER_DEVICE => VALUE_DEVICE,
HEADER_CLIENT => VALUE_CLIENT
)
);
$request->setPort($server_port);
//$request->getCurlOptions()->set(CURLOPT_SSL_VERIFYHOST, false);
//$request->getCurlOptions()->set(CURLOPT_SSL_VERIFYPEER, false);
$response = $client->send($request);
echo $response->getBody();
?>