-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClient.php
More file actions
56 lines (44 loc) · 1.36 KB
/
Client.php
File metadata and controls
56 lines (44 loc) · 1.36 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
namespace Pitwch\RestAPIWrapperProffix;
use Pitwch\RestAPIWrapperProffix\HttpClient\HttpClient;
/**
* Class Client
*
* @package Pitwch\RestAPIWrapperProffix
*/
class Client
{
protected $httpClient;
public function __construct($url, $apiDatabase, $apiUser, $apiPassword, $apiModules, $options = [])
{
$this->httpClient = new HttpClient($url, $apiDatabase, $apiUser, $apiPassword, $apiModules, $options);
}
public function getHttpClient()
{
return $this->httpClient;
}
public function get($endpoint, $parameters = [])
{
return $this->httpClient->request($endpoint, 'GET', [], $parameters);
}
public function post($endpoint, $data = [])
{
return $this->httpClient->request($endpoint, 'POST', $data);
}
public function put($endpoint, $data = [])
{
return $this->httpClient->request($endpoint, 'PUT', $data);
}
public function delete($endpoint, $parameters = [])
{
return $this->httpClient->request($endpoint, 'DELETE', [], $parameters);
}
public function info($px_api_key = '')
{
return $this->httpClient->request('PRO/Info', 'GET', [], ['key' => $px_api_key], false);
}
public function database($px_api_key = '')
{
return $this->httpClient->request('PRO/Datenbank', 'GET', [], ['key' => $px_api_key], false);
}
}